rearrange the structure
I restructed this project today.
Per tom's suggestion, I modified the grammar in the following pattern:
entity = expr:e1 expr:e2 -> classmethod(e1, e2)   # this classmethods returns an correspondent entity.
I think this pattern is quite clean and extensible as we invoke and generate a certain(Query, Name, RRHeader...) entity independently.
PS, -> entity(e1, e2) will cause much trouble as python doesn't support function overloading, which means customizing constructors will break compatibility and restrict extensibility. Considering this, I choose classmethod.

Problem: the name entity relies on the passed in data. However, due to the restriction of classmethod, I cannot access the data as it's an attr of the DNSParser instance.
Possible solution: since data can be accesses by the parsely parser input. I can get the data with ->self. blahblah. I will fix it next time.