<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: A simple lexer in Python</title>
	<atom:link href="http://www.gooli.org/blog/a-simple-lexer-in-python/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gooli.org/blog/a-simple-lexer-in-python/</link>
	<description>on software development and related issues</description>
	<pubDate>Tue, 07 Oct 2008 23:29:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: FÄ±rat KÃœÃ‡ÃœK</title>
		<link>http://www.gooli.org/blog/a-simple-lexer-in-python/#comment-2143</link>
		<dc:creator>FÄ±rat KÃœÃ‡ÃœK</dc:creator>
		<pubDate>Tue, 22 Jan 2008 21:04:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.gooli.org/blog/a-simple-lexer-in-python/#comment-2143</guid>
		<description>good design. congratulations.</description>
		<content:encoded><![CDATA[<p>good design. congratulations.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gooli</title>
		<link>http://www.gooli.org/blog/a-simple-lexer-in-python/#comment-1813</link>
		<dc:creator>gooli</dc:creator>
		<pubDate>Mon, 03 Dec 2007 12:45:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.gooli.org/blog/a-simple-lexer-in-python/#comment-1813</guid>
		<description>I am, but apparently it is only suitable for lexing languages that are similar to shell scripts.</description>
		<content:encoded><![CDATA[<p>I am, but apparently it is only suitable for lexing languages that are similar to shell scripts.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Norbert Klamann</title>
		<link>http://www.gooli.org/blog/a-simple-lexer-in-python/#comment-1812</link>
		<dc:creator>Norbert Klamann</dc:creator>
		<pubDate>Mon, 03 Dec 2007 12:08:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.gooli.org/blog/a-simple-lexer-in-python/#comment-1812</guid>
		<description>Are you aware of the 'shlex' module ?</description>
		<content:encoded><![CDATA[<p>Are you aware of the &#8217;shlex&#8217; module ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gooli</title>
		<link>http://www.gooli.org/blog/a-simple-lexer-in-python/#comment-1562</link>
		<dc:creator>gooli</dc:creator>
		<pubDate>Wed, 24 Oct 2007 21:14:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.gooli.org/blog/a-simple-lexer-in-python/#comment-1562</guid>
		<description>I don't think lexing gets that much more complex, at least as long as you aren't concerned with performance too much. There might be some issues with precedence and you could add support for different start conditions to better support things like C multiline comments. Semantical parsing on the other hand, is a much more complicated matter.

That aperiot module looks really cool. Thanks for the link.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t think lexing gets that much more complex, at least as long as you aren&#8217;t concerned with performance too much. There might be some issues with precedence and you could add support for different start conditions to better support things like C multiline comments. Semantical parsing on the other hand, is a much more complicated matter.</p>
<p>That aperiot module looks really cool. Thanks for the link.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kumar McMillan</title>
		<link>http://www.gooli.org/blog/a-simple-lexer-in-python/#comment-1561</link>
		<dc:creator>Kumar McMillan</dc:creator>
		<pubDate>Wed, 24 Oct 2007 21:07:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.gooli.org/blog/a-simple-lexer-in-python/#comment-1561</guid>
		<description>unfortunately, lexical parsing doesn't remain "simple" for very long!  Last year at Pycon I saw an excellent presentation on aperiot, an easy to use lexical parsing module:
http://moncs.cs.mcgill.ca/people/eposse/projects/aperiot/atglance.dtml
I've never had a good reason to try it out though.</description>
		<content:encoded><![CDATA[<p>unfortunately, lexical parsing doesn&#8217;t remain &#8220;simple&#8221; for very long!  Last year at Pycon I saw an excellent presentation on aperiot, an easy to use lexical parsing module:<br />
<a href="http://moncs.cs.mcgill.ca/people/eposse/projects/aperiot/atglance.dtml" rel="nofollow">http://moncs.cs.mcgill.ca/people/eposse/projects/aperiot/atglance.dtml</a><br />
I&#8217;ve never had a good reason to try it out though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gooli</title>
		<link>http://www.gooli.org/blog/a-simple-lexer-in-python/#comment-1549</link>
		<dc:creator>gooli</dc:creator>
		<pubDate>Mon, 22 Oct 2007 07:19:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.gooli.org/blog/a-simple-lexer-in-python/#comment-1549</guid>
		<description>@James
I did look at the tokenize module, but it can only tokenize Python code. That's great it all you need to do is syntax highlight Python code. But it's not a generic syntax highlighter. The implementation seems to be similar to what I've done although much more complete of course.</description>
		<content:encoded><![CDATA[<p>@James<br />
I did look at the tokenize module, but it can only tokenize Python code. That&#8217;s great it all you need to do is syntax highlight Python code. But it&#8217;s not a generic syntax highlighter. The implementation seems to be similar to what I&#8217;ve done although much more complete of course.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kib2</title>
		<link>http://www.gooli.org/blog/a-simple-lexer-in-python/#comment-1547</link>
		<dc:creator>kib2</dc:creator>
		<pubDate>Sun, 21 Oct 2007 20:22:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.gooli.org/blog/a-simple-lexer-in-python/#comment-1547</guid>
		<description>Thanks a lot for this great article, I've found it very clear and usefull.</description>
		<content:encoded><![CDATA[<p>Thanks a lot for this great article, I&#8217;ve found it very clear and usefull.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Thiele</title>
		<link>http://www.gooli.org/blog/a-simple-lexer-in-python/#comment-1546</link>
		<dc:creator>James Thiele</dc:creator>
		<pubDate>Sun, 21 Oct 2007 17:55:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.gooli.org/blog/a-simple-lexer-in-python/#comment-1546</guid>
		<description>Have you looked at the tokenize module in the standard Python library?</description>
		<content:encoded><![CDATA[<p>Have you looked at the tokenize module in the standard Python library?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gooli</title>
		<link>http://www.gooli.org/blog/a-simple-lexer-in-python/#comment-1543</link>
		<dc:creator>gooli</dc:creator>
		<pubDate>Sun, 21 Oct 2007 07:14:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.gooli.org/blog/a-simple-lexer-in-python/#comment-1543</guid>
		<description>The scanner interface in the sre module is absolutely cool! It's similar to my own implementation but is more efficient using the re.Match's lastindex property.

Thanks for the info.</description>
		<content:encoded><![CDATA[<p>The scanner interface in the sre module is absolutely cool! It&#8217;s similar to my own implementation but is more efficient using the re.Match&#8217;s lastindex property.</p>
<p>Thanks for the info.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Dalke</title>
		<link>http://www.gooli.org/blog/a-simple-lexer-in-python/#comment-1541</link>
		<dc:creator>Andrew Dalke</dc:creator>
		<pubDate>Sat, 20 Oct 2007 23:48:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.gooli.org/blog/a-simple-lexer-in-python/#comment-1541</guid>
		<description>You might also be interested in the undocumented-and-not-official "scanner" interface in the re module.  See http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/457664

The PLY parser uses this sort of approach, but it's hard to find the details because of the extra work it does to do better error reporting.  It also works around limitations in re, like not supporting over 100 tokens, and checking that each regular expression is valid before doing the "&#124;" merge.  Ie, consider 'a(b' and 'c)d' as the two input patterns.  Separate they are not valid, but together they are, along with an extra '()'.</description>
		<content:encoded><![CDATA[<p>You might also be interested in the undocumented-and-not-official &#8220;scanner&#8221; interface in the re module.  See <a href="http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/457664" rel="nofollow">http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/457664</a></p>
<p>The PLY parser uses this sort of approach, but it&#8217;s hard to find the details because of the extra work it does to do better error reporting.  It also works around limitations in re, like not supporting over 100 tokens, and checking that each regular expression is valid before doing the &#8220;|&#8221; merge.  Ie, consider &#8216;a(b&#8217; and &#8216;c)d&#8217; as the two input patterns.  Separate they are not valid, but together they are, along with an extra &#8216;()&#8217;.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
