import AST.*;

public class Test {
  public static void main(String[] args) {
    System.out.println("Building a small AST with generic names which are resolved");
    System.out.println("The tree structure is printed to show the resulting tree nodes");
    Prog p = new Prog(
      new List().add(
        new CompUnit(
          "comp",
          new List().add(
            new ClassDecl("Object", new TypeName("Object"), 
              new List().add(
                // PackageName "comp" . TypeName "Object"
                new FieldDecl(new Dot("dot", new ParseName("comp"), new ParseName("Object")), "f", 
                  // PackageName "comp" . TypeName "Object" . ExpressionName "f"
                  new Dot("dot", new ParseName("comp"), new Dot("dot", new ParseName("Object"), new ParseName("f")))
                )
              )  
            )
          )
        ) 
      )
    );
    String tree = p.printTree();
    System.out.println("Tree: " + tree);
  }
}
