# Dhaka 0.0.5 bugfix

**URL:** <https://www.ruby-forum.com/t/dhaka-0-0-5-bugfix/79445>\
**Category:** Ruby\
**Created:** [December 15, 2006, 7:40am UTC](https://www.ruby-forum.com/t/dhaka-0-0-5-bugfix/79445 "2006-12-15T07:40:11Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mushfeq\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@Mushfeq\_K](https://www.ruby-forum.com/u/Mushfeq_K)\
**Post date:** [December 15, 2006, 7:40am UTC](https://www.ruby-forum.com/t/dhaka-0-0-5-bugfix/79445/1 "2006-12-15T07:40:11Z")

</div>

This version of the Dhaka gem fixes two bugs in the handling of grammars  
that use precedence hints:

- Production precedences were sometimes not being calculated correctly  
because of the grammar not being fully loaded at calculation time. The  
calculation of these precedences is now postponed until they are  
actually  
needed during parser generation. The precedences are needed only when  
resolving conflicts - a rare occurrence - so generation speed isn’t  
really  
affected.
- Parsers created with grammars that used the ‘nonassoc’ precedence hint  
could not be compiled to ruby source. This has been fixed.

As a side note, both the above bugs were found when trying to generate a  
parser for the Ruby grammar. I haven’t tested it extensively for  
correctness, but the automaton for this parser has ~850 states and takes  
~5  
minutes to generate. Amazing how much complexity lurks beneath a  
language  
that ‘fits so easily into one’s head’.

[http://dhaka.rubyforge.org](http://dhaka.rubyforge.org)

Mushfeq.

---

<div class="post-metadata">

**Author:** ![Mushfeq\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@Mushfeq\_K](https://www.ruby-forum.com/u/Mushfeq_K)\
**Post date:** [December 15, 2006, 3:26pm UTC](https://www.ruby-forum.com/t/dhaka-0-0-5-bugfix/79445/2 "2006-12-15T15:26:52Z")

</div>

On Dec 15, 2006, at 12:38 AM, Mushfeq K. wrote:

> This version of the Dhaka gem…

Just curious: what does Dhaka mean?

> As a side note, both the above bugs were found when trying to  
> generate a  
> parser for the Ruby grammar.

I just have to say that the Dhaka project and the side project of  
building a Ruby grammar are just about the two coolest projects I’ve  
seen in Rubyland lately. This is just terrific stuff!

James Edward G. II

---

<div class="post-metadata">

**Author:** ![Mushfeq\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@Mushfeq\_K](https://www.ruby-forum.com/u/Mushfeq_K)\
**Post date:** [December 15, 2006, 4:27pm UTC](https://www.ruby-forum.com/t/dhaka-0-0-5-bugfix/79445/3 "2006-12-15T16:27:10Z")

</div>

On 12/15/06, James Edward G. II [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On Dec 15, 2006, at 12:38 AM, Mushfeq K. wrote:
> 
> > This version of the Dhaka gem…
> 
> Just curious: what does Dhaka mean?

Dhaka is the capital of Bangladesh. IMHO author picked name from there.

---

<div class="post-metadata">

**Author:** ![Mushfeq\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@Mushfeq\_K](https://www.ruby-forum.com/u/Mushfeq_K)\
**Post date:** [December 15, 2006, 9:20pm UTC](https://www.ruby-forum.com/t/dhaka-0-0-5-bugfix/79445/4 "2006-12-15T21:20:08Z")

</div>

Yes, that is indeed correct. Thanks for the encouraging comments.

Jonas, I checked the gem. It’s empty! Doh! I will upload it properly as  
soon  
as I get home from work.

Mushfeq.

---

<div class="post-metadata">

**Author:** ![Mushfeq\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@Mushfeq\_K](https://www.ruby-forum.com/u/Mushfeq_K)\
**Post date:** [December 16, 2006, 2:04am UTC](https://www.ruby-forum.com/t/dhaka-0-0-5-bugfix/79445/5 "2006-12-16T02:04:55Z")

</div>

I’ve replaced the empty gem and RubyForge has done its rounds. ‘gem  
install  
dhaka’ should install the library properly now. My sincerest apologies  
and  
thanks to Jonas for pointing this out.

Mushfeq.

---

<div class="post-metadata">

**Author:** ![Mushfeq\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@Mushfeq\_K](https://www.ruby-forum.com/u/Mushfeq_K)\
**Post date:** [December 15, 2006, 4:27pm UTC](https://www.ruby-forum.com/t/dhaka-0-0-5-bugfix/79445/6 "2006-12-15T16:27:10Z")

</div>

The dhaka-0.5 seems to be empty.

---

<div class="post-metadata">

**Author:** ![Mushfeq\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@Mushfeq\_K](https://www.ruby-forum.com/u/Mushfeq_K)\
**Post date:** [December 26, 2006, 5:33pm UTC](https://www.ruby-forum.com/t/dhaka-0-0-5-bugfix/79445/7 "2006-12-26T17:33:48Z")

</div>

On 12/26/06, HH [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Can you provide any additional examples? For example, creating a  
> simple DSL like LOGO using Dhaka? I think it would really help me  
> understand how to use this library. I think the idea and the concept  
> behind it is quite wonderful!

We are planning to integrate Dhaka with Ruport soon, so more examples  
would make life easier for us, too 🙂

---

<div class="post-metadata">

**Author:** ![Mushfeq\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@Mushfeq\_K](https://www.ruby-forum.com/u/Mushfeq_K)\
**Post date:** [December 26, 2006, 8:01am UTC](https://www.ruby-forum.com/t/dhaka-0-0-5-bugfix/79445/8 "2006-12-26T08:01:09Z")

</div>

Can you provide any additional examples? For example, creating a  
simple DSL like LOGO using Dhaka? I think it would really help me  
understand how to use this library. I think the idea and the concept  
behind it is quite wonderful!

For example, when building a tokenizer – can i have a word as a  
“token” such as “canary” or does each token have to be a single  
character? Based on the examples, they appear to only be single  
characters – I’m doing my best to abstract the information of the  
examples – as to what is part of the library and what is defined by  
the user of the library (e.g. is :idle\_state a key symbol for the  
library?)

I’ll dig into the actually library code at some point.

Thanks for this!

---

<div class="post-metadata">

**Author:** ![Mushfeq\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@Mushfeq\_K](https://www.ruby-forum.com/u/Mushfeq_K)\
**Post date:** [December 29, 2006, 3:30am UTC](https://www.ruby-forum.com/t/dhaka-0-0-5-bugfix/79445/9 "2006-12-29T03:30:38Z")

</div>

Vacationing in a part of the world with no internet access, hence the  
late  
reply. I will totally do this as soon as I get back.

Also, if you have any immediate questions that need answering, just  
email me  
off the list.

Mushfeq.
