document object model for ast nodes, with parent references, queries and validation