[antlr-interest] confused about AST

victor noagbodjivictor at gmail.com
Sat Jul 3 10:50:47 PDT 2010


hello list,

I am currently reading Language Implementation Patterns and I'm quite
confused by ASTs in chapter 4 and 5. This is what's happening.

Chapter 4 talked about Parse Trees and ASTs. Parse Trees were constructed by
adding tree-construction statements to parsing rules. But ASTs were
constructed manually.

So when I got to chapter 5 and I wanted to implement a visitor for my tree I
got stuck. I'm sorry I can't use the examples; I had to translate every
example to Python, the language I use.

I don't really know how and most importantly when to construct the AST. The
book does not say it precisely. I'm thinking if it's done during parsing,
isn't it really a Parse Tree?

Thanks

-- 
victor


More information about the antlr-interest mailing list