<p>For just learning about BNF grammars, a good reference is <a href="http://rads.stackoverflow.com/amzn/click/0201441241" rel="noreferrer">this</a>.</p>

<p>However, since you mentioned its with the interest of developing a compiler, the <a href="http://rads.stackoverflow.com/amzn/click/0201100886" rel="noreferrer">dragon book</a> is probably the best reference possible.</p>

CC BY-SA 2.5
2011-02-12T07:38:16.320Z
2011-02-12T07:38:16.320Z
Vanwaril
<p>I can recommend the <a href="http://www.pragprog.com/titles/tpantlr/the-definitive-antlr-reference" rel="nofollow">ANTLR Reference</a>. It explains many issues with language parsing (without the depth of the Dragon Book, though) and introduces you to a powerful (free) tool, namely a compiler generator. For both reasons, it might be a good starting point for your studies.</p>

CC BY-SA 2.5
2011-02-13T12:59:18.290Z
2011-02-13T12:59:18.290Z
Raphael
<p>I'm taking a basic course on programming language theory, and we're covering context-free grammar (BNF). Personally, I'm really interested in how to design syntax for a programming language. I'm planning to write a simple compiler for my graduate project, so what books are good for this area? Any feedback would be greatly appreciated.</p>

<p>Thanks,<br>
Chan</p>

CC BY-SA 2.5
2011-02-12T07:45:53.040Z
Virtual vote to close as exact duplicate of http://cstheory.stackexchange.com/questions/1955/books-on-automata-theory-for-self-study
Kaveh
CC BY-SA 2.5
2011-02-12T16:25:11.773Z
I don't see it as an identical question @Kaveh. Maybe the *answers* would end up being the same, but the question you linked to seems more logic-directed, whereas this seems more directed toward practical implementation. For example, if @Chan is interested in implementing something in a "hot topic," he could look at the TOOLS section of the [Visibly Pushdown Languages](http://www.cs.uiuc.edu/~madhu/vpa/) page.
Aaron Sterling
CC BY-SA 2.5
2011-02-12T17:01:36.770Z
@Aaron Sterling: Excellent suggestion.
Dave Clarke
<pl.programming-languages><books>
What are good books for learning grammar ( BNF )?
roxrook
# What are good books for learning grammar ( BNF )?

(Asked by: username_0 on 2011-02-12)

I'm taking a basic course on programming language theory, and we're covering context-free grammar (BNF). Personally, I'm really interested in how to design syntax for a programming language. I'm planning to write a simple compiler for my graduate project, so what books are good for this area? Any feedback would be greatly appreciated.

Thanks,  
Chan

**Tags:** pl.programming-languages, books

> **Comments:**
> **username_1**: Virtual vote to close as exact duplicate of http://cstheory.stackexchange.com/questions/1955/books-on-automata-theory-for-self-study  
> **username_2**: I don't see it as an identical question @username_1. Maybe the *answers* would end up being the same, but the question you linked to seems more logic-directed, whereas this seems more directed toward practical implementation. For example, if @Chan is interested in implementing something in a "hot topic," he could look at the TOOLS section of the [Visibly Pushdown Languages](http://www.cs.uiuc.edu/~madhu/vpa/) page.  
> **username_3**: @username_2: Excellent suggestion.  

---

## 2 answers

### Answer by username_4 on 2011-02-12. Score: 5 | Accepted answer

For just learning about BNF grammars, a good reference is [this](http://rads.stackoverflow.com/amzn/click/0201441241).

However, since you mentioned its with the interest of developing a compiler, the [dragon book](http://rads.stackoverflow.com/amzn/click/0201100886) is probably the best reference possible.


---

### Answer by username_5 on 2011-02-13. Score: 3

I can recommend the [ANTLR Reference](http://www.pragprog.com/titles/tpantlr/the-definitive-antlr-reference). It explains many issues with language parsing (without the depth of the Dragon Book, though) and introduces you to a powerful (free) tool, namely a compiler generator. For both reasons, it might be a good starting point for your studies.


---

