<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Text parsing, formal grammars and BNF introduction</title>
	<atom:link href="http://eikke.com/text-parsing-formal-grammars-and-bnf-introduction/feed/" rel="self" type="application/rss+xml" />
	<link>http://eikke.com/text-parsing-formal-grammars-and-bnf-introduction/</link>
	<description>&#039;cause this is what I do</description>
	<lastBuildDate>Tue, 20 Jul 2010 21:44:33 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: preeti</title>
		<link>http://eikke.com/text-parsing-formal-grammars-and-bnf-introduction/comment-page-1/#comment-31296</link>
		<dc:creator>preeti</dc:creator>
		<pubDate>Sat, 30 Jan 2010 17:16:02 +0000</pubDate>
		<guid isPermaLink="false">http://eikke.com/text-parsing-formal-grammars-and-bnf-introduction/#comment-31296</guid>
		<description>hi i need a source coding,to check the given expression in numbers is valid or not by using c programming</description>
		<content:encoded><![CDATA[<p>hi i need a source coding,to check the given expression in numbers is valid or not by using c programming</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sar</title>
		<link>http://eikke.com/text-parsing-formal-grammars-and-bnf-introduction/comment-page-1/#comment-4065</link>
		<dc:creator>sar</dc:creator>
		<pubDate>Fri, 23 May 2008 17:52:30 +0000</pubDate>
		<guid isPermaLink="false">http://eikke.com/text-parsing-formal-grammars-and-bnf-introduction/#comment-4065</guid>
		<description>Hi, 

I&#039;am a student , and as  a project I have to write a grammar (LBNF one) -and it&#039;s ok for it-; then, I have to use the BNFC, and  that&#039;s th  e pb i.e. Idon&#039;t  know how to use it.

Please  help me. and thanks a lot.

Best regards.</description>
		<content:encoded><![CDATA[<p>Hi, </p>
<p>I&#8217;am a student , and as  a project I have to write a grammar (LBNF one) -and it&#8217;s ok for it-; then, I have to use the BNFC, and  that&#8217;s th  e pb i.e. Idon&#8217;t  know how to use it.</p>
<p>Please  help me. and thanks a lot.</p>
<p>Best regards.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ethana2</title>
		<link>http://eikke.com/text-parsing-formal-grammars-and-bnf-introduction/comment-page-1/#comment-188</link>
		<dc:creator>ethana2</dc:creator>
		<pubDate>Mon, 21 Jan 2008 08:45:27 +0000</pubDate>
		<guid isPermaLink="false">http://eikke.com/text-parsing-formal-grammars-and-bnf-introduction/#comment-188</guid>
		<description>Lojban would have been perfect if it had a proper phonetic base.
After I fork it and make the Best Language on Earth, we can avoid this nonsense ;)</description>
		<content:encoded><![CDATA[<p>Lojban would have been perfect if it had a proper phonetic base.<br />
After I fork it and make the Best Language on Earth, we can avoid this nonsense <img src='http://eikke.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: RubenV</title>
		<link>http://eikke.com/text-parsing-formal-grammars-and-bnf-introduction/comment-page-1/#comment-178</link>
		<dc:creator>RubenV</dc:creator>
		<pubDate>Sun, 20 Jan 2008 19:52:46 +0000</pubDate>
		<guid isPermaLink="false">http://eikke.com/text-parsing-formal-grammars-and-bnf-introduction/#comment-178</guid>
		<description>Nicolas: You&#039;re cheating there by combining recursion and regular expressions :-). Pure regular expressions can&#039;t do that. Recursion is actually what sets regular languages and context free grammars apart.</description>
		<content:encoded><![CDATA[<p>Nicolas: You&#8217;re cheating there by combining recursion and regular expressions <img src='http://eikke.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . Pure regular expressions can&#8217;t do that. Recursion is actually what sets regular languages and context free grammars apart.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nicolas</title>
		<link>http://eikke.com/text-parsing-formal-grammars-and-bnf-introduction/comment-page-1/#comment-177</link>
		<dc:creator>Nicolas</dc:creator>
		<pubDate>Sun, 20 Jan 2008 18:30:02 +0000</pubDate>
		<guid isPermaLink="false">http://eikke.com/text-parsing-formal-grammars-and-bnf-introduction/#comment-177</guid>
		<description>no one in particular: indeed... I translated it somewhat badly. So to be correct:
&lt;ul&gt;&lt;li&gt;whole_number ::= digit &#124; nzdigit digits&lt;/li&gt;
&lt;li&gt;sign ::= &quot;-&quot; &#124; &quot;+&quot; &#124; &quot;&quot;&lt;/li&gt;
&lt;li&gt;integer ::= sign whole_number&lt;/li&gt;&lt;/ul&gt;

Ruben: out of my head, if input is &#039;foo(bar(baz)bat)&#039;, can&#039;t you do something like
&lt;pre&gt;parts = []
regex = &#039;^([.^(]*)[\(([.^)]*)\)]*(.*)$&#039;

def parse(s):
    parts = regex.parse(s)
    parts.append(parts[0])
    for i in range(1, len(parts)):
        parse(parts[i])

parse(s)&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>no one in particular: indeed&#8230; I translated it somewhat badly. So to be correct:</p>
<ul>
<li>whole_number ::= digit | nzdigit digits</li>
<li>sign ::= &#8220;-&#8221; | &#8220;+&#8221; | &#8220;&#8221;</li>
<li>integer ::= sign whole_number</li>
</ul>
<p>Ruben: out of my head, if input is &#8216;foo(bar(baz)bat)&#8217;, can&#8217;t you do something like</p>
<pre>parts = []
regex = '^([.^(]*)[\(([.^)]*)\)]*(.*)$'

def parse(s):
    parts = regex.parse(s)
    parts.append(parts[0])
    for i in range(1, len(parts)):
        parse(parts[i])

parse(s)</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: RubenV</title>
		<link>http://eikke.com/text-parsing-formal-grammars-and-bnf-introduction/comment-page-1/#comment-176</link>
		<dc:creator>RubenV</dc:creator>
		<pubDate>Sun, 20 Jan 2008 17:46:42 +0000</pubDate>
		<guid isPermaLink="false">http://eikke.com/text-parsing-formal-grammars-and-bnf-introduction/#comment-176</guid>
		<description>Nicolas: Try expressing a language which recognizes balanced brackets, which can be arbitrarily nested using a regular expression.

Fairly trivial in BNF, impossible to implement using traditional regular expressions.</description>
		<content:encoded><![CDATA[<p>Nicolas: Try expressing a language which recognizes balanced brackets, which can be arbitrarily nested using a regular expression.</p>
<p>Fairly trivial in BNF, impossible to implement using traditional regular expressions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: no one in particular</title>
		<link>http://eikke.com/text-parsing-formal-grammars-and-bnf-introduction/comment-page-1/#comment-175</link>
		<dc:creator>no one in particular</dc:creator>
		<pubDate>Sun, 20 Jan 2008 17:46:14 +0000</pubDate>
		<guid isPermaLink="false">http://eikke.com/text-parsing-formal-grammars-and-bnf-introduction/#comment-175</guid>
		<description>For the record, note that you&#039;ve described the whole numbers, not the integers, because integers include negative numbers.

(I&#039;m not trying to be annoying, but I figured it was worth pointing out.  Thanks for the interesting read!)</description>
		<content:encoded><![CDATA[<p>For the record, note that you&#8217;ve described the whole numbers, not the integers, because integers include negative numbers.</p>
<p>(I&#8217;m not trying to be annoying, but I figured it was worth pointing out.  Thanks for the interesting read!)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mattias Bengtsson</title>
		<link>http://eikke.com/text-parsing-formal-grammars-and-bnf-introduction/comment-page-1/#comment-173</link>
		<dc:creator>Mattias Bengtsson</dc:creator>
		<pubDate>Sun, 20 Jan 2008 14:32:19 +0000</pubDate>
		<guid isPermaLink="false">http://eikke.com/text-parsing-formal-grammars-and-bnf-introduction/#comment-173</guid>
		<description>I&#039;ve been using BNFC (BNF Converter) for some compiler construction courses at school. I think it is a really neat project. It can generate Java, Haskell and C++-parsers. I&#039;m not sure if it can output Python parsers though.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve been using BNFC (BNF Converter) for some compiler construction courses at school. I think it is a really neat project. It can generate Java, Haskell and C++-parsers. I&#8217;m not sure if it can output Python parsers though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nicolas</title>
		<link>http://eikke.com/text-parsing-formal-grammars-and-bnf-introduction/comment-page-1/#comment-171</link>
		<dc:creator>Nicolas</dc:creator>
		<pubDate>Sun, 20 Jan 2008 12:41:03 +0000</pubDate>
		<guid isPermaLink="false">http://eikke.com/text-parsing-formal-grammars-and-bnf-introduction/#comment-171</guid>
		<description>Anonymous: correct! Fixed, thanks.

Fok: I kinda dislike the non-Pythoness of Yakk, and as a result the kinda hard to understand syntax of PLY. Thanks for the pointer though :-)

Ruben: can&#039;t any BNF definition be translated into a set of regular expressions and controller code?</description>
		<content:encoded><![CDATA[<p>Anonymous: correct! Fixed, thanks.</p>
<p>Fok: I kinda dislike the non-Pythoness of Yakk, and as a result the kinda hard to understand syntax of PLY. Thanks for the pointer though <img src='http://eikke.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Ruben: can&#8217;t any BNF definition be translated into a set of regular expressions and controller code?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: RubenV</title>
		<link>http://eikke.com/text-parsing-formal-grammars-and-bnf-introduction/comment-page-1/#comment-169</link>
		<dc:creator>RubenV</dc:creator>
		<pubDate>Sun, 20 Jan 2008 11:50:27 +0000</pubDate>
		<guid isPermaLink="false">http://eikke.com/text-parsing-formal-grammars-and-bnf-introduction/#comment-169</guid>
		<description>Interesting, but I think the issue of ambiguous grammars is missing. These bring their own class of problems.

Also, it might be interesting to mention the fact that regular expressions simply cannot represent the same class of languages as grammars. This is the very reason one would like to use grammars, which are inherently harder to parse (you need a PDA whereas a regular expression can be processed using a finite state automaton). On the other hand, the inexpressivity of regular expressions is the reason why they are used that often, they can be implemented very efficiently. You see, there is no free lunch :-)

I can highly recommend Michael Sipser&#039;s book on this topic: Introduction to the Theory of Computation. It&#039;s a bit tough, but highly comprehensive (and very well written). More here: http://www-math.mit.edu/~sipser/book.html</description>
		<content:encoded><![CDATA[<p>Interesting, but I think the issue of ambiguous grammars is missing. These bring their own class of problems.</p>
<p>Also, it might be interesting to mention the fact that regular expressions simply cannot represent the same class of languages as grammars. This is the very reason one would like to use grammars, which are inherently harder to parse (you need a PDA whereas a regular expression can be processed using a finite state automaton). On the other hand, the inexpressivity of regular expressions is the reason why they are used that often, they can be implemented very efficiently. You see, there is no free lunch <img src='http://eikke.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>I can highly recommend Michael Sipser&#8217;s book on this topic: Introduction to the Theory of Computation. It&#8217;s a bit tough, but highly comprehensive (and very well written). More here: <a href="http://www-math.mit.edu/~sipser/book.html" rel="nofollow">http://www-math.mit.edu/~sipser/book.html</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
