Parsing System (v0.9)
|
FAQ
Q: How can I use Goldie to create a compiler?A: This is not an easy task no matter what parsing tool you use. To get started, see the Never Used a Parsing Tool? page which contains an overview of everything involved in creating a full compiler. In summary: Use Goldie to implement a lexer/parser (see Goldie Overview and the Beginner's Tutorial), and then, just as with any other parsing tool, you'll have to do your own semantic analysis on the resulting tree, and then implement a compiler backend. Q: Why the name "Goldie"?A: "GOLD for D" -> "GOLD D" -> "Goldie" Q: How do I refer to a rule that has no subtokens?A: Use null for the list of subtokens. For details and examples, see Referring to a rule that has no subtokens on the GoldieLib Overview page. Q: Can Goldie parse the D language?Short answer: Lexing: Mostly, yes (see the included dlex.grm). Parsing: Not yet. Long answer: See this newsgroup discussion thread. Q: I'm getting "Ambiguous symbol" errors!A: See Ambiguous Symbols. Q: This project sounds very similar to Gazelle. What's the difference, and which one is better?A: GOLD/Goldie and Gazelle are both members of a new class of generic parsers that focus on fully-reusable grammars that aren't tied to any particular host language. They both accomplish this by completely separating the grammar from the parsing engine. Both systems have their pros and cons, and which one's better is up to you. They're both evolving, so limitations on both sides are likely to change. Here is a comparison (disclaimer: based on my admittedly limited knowledge of Gazelle) so you can decide for yourself:
(If anything in this comparison appears to be wrong or out-of-date, I invite you to file a bug report.) Q: What about Goldie vs. ANTLR?A: While Goldie and Gazelle are in roughly the same class, ANTLR is very different in that grammars are not independent from the host language.
(If anything in this comparison appears to be wrong or out-of-date, I invite you to file a bug report.) Q: Are these questions really frequently-asked?A: No, I'm just anticipating most of them. ;) |