Evaluating parse trees with getattr