ASTNode (int role) { LOG.assertTrue(ChildRole.isUnique(role)); switch (role) { default: return null; case ChildRole.LPARENTH: TreeElement firstNode = getFirstChildNode(); return firstNode.getElementType() == LPARENTH ? firstNode : null; case ChildRole.RPARENTH: TreeElement lastNode = getLastChildNode(); return lastNode.getElementType() == RPARENTH ? lastNode : null; } }