complete AST tree construction