<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Object Mentor Blog: Another Kata: Expression Tokenizer</title>
    <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>Another Kata: Expression Tokenizer</title>
      <description>&lt;p&gt;I continue to work on some examples for upcoming kata&amp;#8217;s at the &lt;a href="http://okccoco.com/"&gt;OkC CoCo&lt;/a&gt;. The next problem (&lt;a href="http://blog.objectmentor.com/articles/2009/06/24/shunting-yard-algorithm-kata"&gt;previously mentioned here&lt;/a&gt;) is an implementation of the &lt;a href="http://en.wikipedia.org/wiki/Shunting_yard_algorithm"&gt;Shunting Yard Algorithm&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;This past week I used that with a group in North Carolina and I discovered that it was much easier to tokenize the expression as I worked my way through it rather than attempt to make it easy to split into tokens up front.&lt;/p&gt;


	&lt;p&gt;I worked through just this smaller problem of converting an expression into tokens using the iterator pattern a few times and eventually got what I thought was a pretty good solution. I was wrong, I got it even tighter by making more appropriate use of the regular expression libraries in Java. (This is an example of where my regex mental model &amp;#8211; based primarily on grep, vi and &lt;span class="caps"&gt;AWK&lt;/span&gt; &amp;#8211; was inadequate when taking into consideration typical implementations of regex libraries with classes like Pattern and Matcher.)&lt;/p&gt;


	&lt;p&gt;Anyway, here&amp;#8217;s a writeup for that Kata: &lt;a href="http://schuchert.wikispaces.com/Katas.ExpressionTokenizer"&gt;http://schuchert.wikispaces.com/Katas.ExpressionTokenizer&lt;/a&gt;.&lt;/p&gt;


My final version turned into something crazy-short. I&lt;i&gt; &lt;b&gt;did not&lt;/b&gt;&lt;/i&gt; anticipate the final version. Part of it, as mentioned above, had to do with how I previously envisioned using regular expressions. Part of it might have been that it just took a few times for the patterns naturally occurring to become evident to me. In any case, working through this problem three times resulted in the following revelations:
	&lt;ul&gt;
	&lt;li&gt;Initially I though it would be hard, it was not and in fact much less work than what I was doing in the original problem. And it took a lot less time than I expected.&lt;/li&gt;
		&lt;li&gt;The second time around I was looking to duplicate the experience, which I did. But I saw quite a bit of improvement.&lt;/li&gt;
		&lt;li&gt;The final version was really an a-ah for me. Initially it was just like the second version. Then, once I had the tests in the kata written, I started messing around, looking for additional improvements (and heavily applying the &lt;span class="caps"&gt;DRY&lt;/span&gt; principle). I found them, exploited commonality and finally I got to the point where there was one thing I did not like, and fixing that led to a huge improvement, which led to a few more significant improvements.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Ultimately, I&amp;#8217;ll have several useful take-aways from working on the problem several times.&lt;/p&gt;


	&lt;p&gt;If you&amp;#8217;d like to see the &amp;#8220;latest final version&amp;#8221; of this, ping me. I&amp;#8217;ll consider posting it to the blog, but I&amp;#8217;d rather not give anything away without a specific request.&lt;/p&gt;</description>
      <pubDate>Mon, 29 Jun 2009 01:49:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:0f979834-b53e-47c3-b633-efa371bad5ad</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>kata</category>
      <category>practice</category>
      <category>regex</category>
    </item>
    <item>
      <title>"Another Kata: Expression Tokenizer" by Judaica store</title>
      <description>&lt;p&gt;The best blog&lt;/p&gt;</description>
      <pubDate>Sat, 24 Jul 2010 22:28:10 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:ac6fb120-db48-4ed0-8e8a-d0b0c57a110e</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer#comment-17304</link>
    </item>
    <item>
      <title>"Another Kata: Expression Tokenizer" by Aluminum</title>
      <description>&lt;p&gt;Great blog thanks.&lt;/p&gt;</description>
      <pubDate>Tue, 15 Jun 2010 01:37:08 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:8d953b50-cb15-48f1-8bb7-32f9682821ca</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer#comment-13116</link>
    </item>
    <item>
      <title>"Another Kata: Expression Tokenizer" by http://www.panelal.co.il</title>
      <description>&lt;p&gt;Great blog thanks.&lt;/p&gt;</description>
      <pubDate>Tue, 15 Jun 2010 01:36:27 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:fcd00c32-7f9c-4660-95e2-0ce15b27f37d</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer#comment-13115</link>
    </item>
    <item>
      <title>"Another Kata: Expression Tokenizer" by fff</title>
      <description>&lt;p&gt;&lt;a &gt;asd&lt;/a rel="nofollow"&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 03 Jun 2010 07:35:53 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:81e9ce72-860b-4bb8-8995-1dc0d3b41c7a</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer#comment-12420</link>
    </item>
    <item>
      <title>"Another Kata: Expression Tokenizer" by Eli</title>
      <description>&lt;p&gt;&amp;lt;a href=&amp;#8221;&lt;a href="http://www.clickon.co.il/he-il/about/what-is-affiliate-network.htm" rel="nofollow"&gt;http://www.clickon.co.il/he-il/about/what-is-affiliate-network.htm&lt;/a&gt;
//&amp;#8221;&amp;gt;??? ??? ????
 ?? ?? ?? ????&lt;/p&gt;</description>
      <pubDate>Wed, 07 Apr 2010 12:17:42 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:329503b8-c3bc-4243-8e06-aab549c0dab5</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer#comment-9328</link>
    </item>
    <item>
      <title>"Another Kata: Expression Tokenizer" by FLV extractor</title>
      <description>&lt;p&gt;so it is&lt;/p&gt;</description>
      <pubDate>Wed, 07 Apr 2010 03:33:34 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:b51e8588-ca80-4243-b9fd-92596c6e32a0</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer#comment-9289</link>
    </item>
    <item>
      <title>"Another Kata: Expression Tokenizer" by Eli</title>
      <description>&lt;p&gt;? ?? ??? &lt;a href="http://www.auto.co.il/%D7%A8%D7%9B%D7%91_%D7%97%D7%93%D7%A9.aspx/" rel="nofollow"&gt;? ?&lt;/a&gt; ?? ???? ??? ?? ??&lt;/p&gt;</description>
      <pubDate>Sun, 28 Mar 2010 10:34:41 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:f291f582-d43f-4d59-8bf6-3432a4a0311a</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer#comment-8331</link>
    </item>
    <item>
      <title>"Another Kata: Expression Tokenizer" by Itay</title>
      <description>&lt;p&gt;? ??? ?? &lt;a href="http://www.gome.co.il/?categoryId=20422" rel="nofollow"&gt;?? ??&lt;/a&gt; ??? ???&lt;/p&gt;</description>
      <pubDate>Sun, 28 Feb 2010 10:00:52 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:cbaf7e6c-f53b-4c5e-9303-245d522fc01d</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer#comment-7659</link>
    </item>
    <item>
      <title>"Another Kata: Expression Tokenizer" by itamar</title>
      <description>&lt;p&gt;? ?? ??? ??? ?? ?? ??,???? ?? ??? ???? ?? ? ?? ?? ???&lt;/p&gt;</description>
      <pubDate>Sun, 28 Feb 2010 09:59:03 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:09500985-9291-49bf-8d98-0d11a3fd3bb2</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer#comment-7658</link>
    </item>
    <item>
      <title>"Another Kata: Expression Tokenizer" by ?????????</title>
      <description>&lt;p&gt;??? ?? ? ?? ????? ?? ?? ?? ? ???? ?? ??? ? ??? ??? ? ??? ??&lt;/p&gt;</description>
      <pubDate>Tue, 01 Dec 2009 02:29:56 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:74474bbd-ea31-4ef5-a9c2-6a5fc3b44fed</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer#comment-5348</link>
    </item>
    <item>
      <title>"Another Kata: Expression Tokenizer" by daniel</title>
      <description>&lt;p&gt;??? ?? ? ?? ????? ?? ?? ?? ? ???? ?? ??? ? ??? ??? ? ??? ??&lt;/p&gt;</description>
      <pubDate>Tue, 01 Dec 2009 02:29:32 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:7b1799e4-7dba-4db2-8c6e-6a2f263f4344</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer#comment-5347</link>
    </item>
    <item>
      <title>"Another Kata: Expression Tokenizer" by ??????? ???????</title>
      <description>&lt;p&gt;?? ?? ?? &lt;a href="http://www.goodlook.co.il" rel="nofollow"&gt;??? ?????&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 19 Nov 2009 09:52:38 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:b80ec2b8-3736-4bd7-ba03-f9fdc82ff699</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer#comment-5167</link>
    </item>
    <item>
      <title>"Another Kata: Expression Tokenizer" by drums</title>
      <description>&lt;p&gt;ldf&lt;/p&gt;</description>
      <pubDate>Wed, 28 Oct 2009 03:33:56 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:8e4ccf03-f058-47bd-8917-f11c3017bdfd</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer#comment-4919</link>
    </item>
    <item>
      <title>"Another Kata: Expression Tokenizer" by ???? ???????</title>
      <description>&lt;p&gt;?? ?????&lt;/p&gt;


	&lt;p&gt;?? ?? &amp;#8211; ??? ??? ???? ? &amp;#8211; ?? ?????.
 ?? ??? ??????&lt;/p&gt;


	&lt;p&gt;?? ??? ??? ???? ??  10 ?? 80 ???.&lt;/p&gt;


	&lt;p&gt;??? ?? ???? ???? ?? ?? ????.&lt;/p&gt;


	&lt;p&gt;?? ??? ?? ??? ???? ?:                                                           ??? &#8211; ??? ???? &#8211; ? ?? ????? .&lt;/p&gt;


	&lt;p&gt;?? ??? ? ?? ?? ??? ??? ?? ?? ?? ? ?? ?? ????.
??? ??? ?? ???? ??? ??? ?? ??? ,
(? ? ??? ?? ??? ?? ???? ) , ? ?? ?? ??? ? ?? ? ?? ???? ??  ??? ? ???? ?? ??? ??? , ???? , ??? ?? ???, ??? ??, ? ??? ?? ?? ?? ??? &amp;#8217;???? &amp;#8217;.&lt;/p&gt;</description>
      <pubDate>Wed, 12 Aug 2009 04:48:54 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:4c1153fd-527f-4f34-a303-fa72460ba065</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer#comment-3927</link>
    </item>
    <item>
      <title>"Another Kata: Expression Tokenizer" by ???? ?????</title>
      <description>&lt;p&gt;??? ??? ?? ?? ??? ??? ??? ??? &amp;#8211; ?? ??? ? ? ??? ?? ?? ??, ?? ?? ??? ? , ? ?? ??? ?? ?? ???  ???? ??? ? ?? ??.&lt;/p&gt;</description>
      <pubDate>Wed, 12 Aug 2009 04:46:45 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:e34b0fb6-bd96-4781-908c-eb05ad29bc16</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer#comment-3926</link>
    </item>
    <item>
      <title>"Another Kata: Expression Tokenizer" by ??????</title>
      <description>&lt;p&gt;? ??? ?? ???? ?? ?? ??? (??? ?? ??...) ???, ???, ???? ???- ?? ?? ?? ??. ?? ? ?? ???: ?? ??? ? ??? ???? ?? ???, ??? ? ???? ??? ? ??? ???, ?????? ????, ??? ?? ???, ???, ??? ??&amp;#8217;?? ?? ??? ??-? ?? ?? ?? ??? ???? ?? ?? ??? ??, ?? ???? ??? ?? ??? ?? ??? ??, ???, ?????.&lt;/p&gt;</description>
      <pubDate>Wed, 12 Aug 2009 04:45:29 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:918aca31-baac-400d-a900-60c8ede234e6</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer#comment-3925</link>
    </item>
    <item>
      <title>"Another Kata: Expression Tokenizer" by ????? ????????</title>
      <description>&lt;p&gt;?? ??? ?? ????? ???? . ??? ???? ?? ?? ? ?? ?? ? ?? ? ?? ? ?? . ?? ?? ????? ?? ???? ?? ??? ?? ? ?? ?? ?? ?? ??? ??? ?? ??? ?? ?? ?? ????? ???? ??? ???? ?? ??? ??? ??? ?? ?? ??? ?? ?? ??? . ?? ????? ? ?? ??? ? ??? ???? ??? ?? ??? ??? ?? ??? ???? ?? ????? . ?? ???? ????? ? ??? ?? ?? ? ?? ?? ?? ?? ?? ??? ?? ???? ??? ??? ??? ?? ?? ?? ????? ?? ?? ?? ?? ??? ? ??? ? ??? ?? ? ?? . ???? ????? ? ??? ??? ?? ?? ? ??? ??? ???? ??? ??? ??? ??? ??? ??? ???? ?? ?? 1500 ?? 2000 ???. ??. ? ?? ??? ???? ?? ?? ??? ?? ?? ?? ?? ?? ? ?? ?? ?? ???? ????? ?? ????? ? ?? ?? ? ??? ? ??? ??? ?? ??? ???? ????? ? ?? ?? ?? ??? ??? ?? ??? ???? ?? ??? ?? . ? ? ? ??? ??? ?? ?? ??? ??? ??? ?? ?? ? ?? ???? .&lt;/p&gt;</description>
      <pubDate>Thu, 06 Aug 2009 00:37:46 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:46ba25e4-59c2-4d50-9548-4ad5c7494f7e</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer#comment-3863</link>
    </item>
    <item>
      <title>"Another Kata: Expression Tokenizer" by ????? ?????</title>
      <description>&lt;p&gt;? ?? ? ???? ??? ??. ??? ? ?? ???? ?? ??? ??? ? ?? ? ?? ?? ??. ??? ??? ???? ?? ??? ??? ???? ?? ?? ???? ???? . ?? ?? ??? ??? ?? ?? ???? ?? ?? ?? ??? ???? ???. ??? ?? ?? ?? ? ? ?? ?? ?? ??, ?? ?? ?? ? ?? ??? ??? ??? ?? ? ???? ?? ?? ??. ? ? ??? ??? ??? ?? ?? ?? ?? ? 13 ?? ?? ??&amp;#8221;? ? ??, ??? ?? ?? ??? ? ???? ??? , ?? ??? ??? ?? ??? ?? ??? ?? ?? ?? ?? ?? ?? ?? ??? ??? ?? ??. ???? ?? ??? ?? ? ?? ??? ??? ??? ?? ?? ??? ???? ???. ?? ?? ? ?? ?? ?? ??? ??? ?? ??? ??? ??? ?? ?? ?? ??? ??? ?? ??? ???? ?? ? ?? ??? ??? ? ??? ?? ?? ?? ?? ?? ??? ?? ?? ?? ?? ?? ??? ??.?? . ?? ?? ?? ?? ?? ??? ??? ?? ??? ???. ??? ??? ?? ?? ? ??? ?? ?? 2000 ?? ??? ? ? ?? ??? ???? ?? ? ?? ? ??? ?? 1200 ?? . ?? ?? ?? ?? ?? ?? ?? ???, ? ? ?? ??? ?? ??? ???? ?? ?? ??? ? ?? ? ??? ???? ????? ??? ???? ???? ??.&lt;/p&gt;</description>
      <pubDate>Thu, 06 Aug 2009 00:37:14 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:b43c62df-0fd7-449d-81a1-518c2064291c</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer#comment-3862</link>
    </item>
    <item>
      <title>"Another Kata: Expression Tokenizer" by  ??? ???????</title>
      <description>&lt;p&gt;?? ?? ?? ? ???...&lt;/p&gt;</description>
      <pubDate>Mon, 03 Aug 2009 05:06:24 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:03611591-2c66-43ba-ae5a-aab3d6c4363c</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer#comment-3832</link>
    </item>
    <item>
      <title>"Another Kata: Expression Tokenizer" by  ????? ??? ??????</title>
      <description>&lt;p&gt;??? ?? ?? ? ? ??? ??????&lt;/p&gt;</description>
      <pubDate>Mon, 03 Aug 2009 05:04:15 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:5c9190f6-2cf6-44b9-bb07-bbbe2c476f8b</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer#comment-3831</link>
    </item>
    <item>
      <title>"Another Kata: Expression Tokenizer" by ????? ???? ?????</title>
      <description>&lt;p&gt;? ? ??? ?? ??? ?? ?? ??? ??? ????&lt;/p&gt;</description>
      <pubDate>Mon, 03 Aug 2009 05:01:46 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:197e6a4a-952d-4238-954a-4e91a96beb80</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer#comment-3830</link>
    </item>
    <item>
      <title>"Another Kata: Expression Tokenizer" by ??????? ??????</title>
      <description>&lt;p&gt;??? ?? ? ???? ??, ??? ??? ???? ??? ???&lt;/p&gt;</description>
      <pubDate>Mon, 03 Aug 2009 04:57:24 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:22d327f8-39db-4b4e-8022-f86cb854fbc4</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer#comment-3829</link>
    </item>
    <item>
      <title>"Another Kata: Expression Tokenizer" by ????? ?????</title>
      <description>&lt;p&gt;??? ??? ??? , ??? ? ??&lt;/p&gt;</description>
      <pubDate>Mon, 03 Aug 2009 04:55:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:da2fcf98-42b0-451f-873a-a0b9b3b30548</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer#comment-3828</link>
    </item>
    <item>
      <title>"Another Kata: Expression Tokenizer" by http://www.xn--5dbfbum6aa1cpp.com/images/spacer.gif</title>
      <description>&lt;p&gt;?? ??? ??? ??? ?? ?? ? ?
&lt;a href="http://www.xn" rel="nofollow"&gt;http://www.xn&lt;/a&gt;&amp;#8212;5dbfbum6aa1cpp.com/images/spacer.gif&lt;/p&gt;


	&lt;p&gt;??? ???
&lt;a href="http://www.xn" rel="nofollow"&gt;http://www.xn&lt;/a&gt;&amp;#8212;5dbfbum6aa1cpp.com/&lt;/p&gt;</description>
      <pubDate>Mon, 03 Aug 2009 04:45:11 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:51be43ea-2a54-493c-989e-c66885e52a5d</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer#comment-3827</link>
    </item>
    <item>
      <title>"Another Kata: Expression Tokenizer" by http://www.xn--5dbfbum6aa1cpp.com/</title>
      <description>&lt;p&gt;???? ? ???? ?? ?? ?? ??  ???? ?? ??&lt;/p&gt;</description>
      <pubDate>Mon, 03 Aug 2009 04:40:17 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:a31b3002-1da2-484a-8dd7-67dde8ffb70e</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/29/another-kata-expression-tokenizer#comment-3826</link>
    </item>
  </channel>
</rss>
