Object-oriented AST

Thomas Weiss <dev@weiss.nom.fr>
8 Apr 2006 17:13:53 -0400

          From comp.compilers

Related articles
Object-oriented AST dev@weiss.nom.fr (Thomas Weiss) (2006-04-08)
Re: Object-oriented AST liekweg@gmx.de (Florian Liekweg) (2006-04-09)
Re: Object-oriented AST cfc@shell01.TheWorld.com (Chris F Clark) (2006-04-12)
Re: Object-oriented AST dev@weiss.nom.fr (Thomas Weiss) (2006-04-16)
| List of all articles for this month |

From: Thomas Weiss <dev@weiss.nom.fr>
Newsgroups: comp.compilers
Date: 8 Apr 2006 17:13:53 -0400
Organization: Compilers Central
Keywords: AST, question
Posted-Date: 08 Apr 2006 17:13:53 EDT

Hello,


Absolute beginner in compiler construction, I am looking for an
efficient way to design abstract syntax trees in object-oriented
languages. The interpreter design pattern tells us that the BNF rule
a : b | c can lead to the following design :
class a {}
class b : a {}
class c : a {}


That's fine, b & c are indeed specialized versions of a. But BNF
grammars are rarely simple. Especially, how should be designed an AST
reflecting the following rules :
a : b | c
d : e | c
?


Thank you for your help,


Thomas


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.