Java AST Tree

irishScott

Lifer
Oct 10, 2006
21,562
3
0
Is it one tree with a "master root" or a series of trees with import statements, class declaration, etc as roots?
 

statik213

Golden Member
Oct 31, 2004
1,654
0
0
Can you expand a little more? What exactly do you mean by AST? Abstract Syntax Tree? If so, in what context?
Also... if it is a "tree" it should have only one root... or else it's not really a tree.
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Writing a compiler? Seems to me there's a few ways you could look at it. Each file is it's own tree, sure. Of course you can't compile a single java file without taking other things into account. You could probably view the package hierarchy as a tree, with either source code or a pre-compiled class at each node. I don't think you'd need anything outside of that. I'm trying to think of how classloading could come into play during compilation and I don't think it can...