( ( When ( ( in danger ) ( , ( ( ( ( ( the osmeterium ) , ) ( which ( looks ( like ( ( a ( snake 's ) ) tongue ) ) ) ) ) , ) ( ( ( everts and ) releases ) ( a foul ) ) ) ) ) ) ( ( smell ( to ( repel predators ) ) ) . ) )
(ROOT (S (SBAR (WHADVP (WRB When)) (S (PP (IN in) (NP (NN danger))) (, ,) (NP (NP (DT the) (NN osmeterium)) (, ,) (SBAR (WHNP (WDT which)) (S (VP (VBZ looks) (PP (IN like) (NP (NP (DT a) (NN snake) (POS 's)) (NN tongue)))))) (, ,)) (VP (VBZ everts) (CC and) (VBZ releases) (NP (DT a) (JJ foul))))) (VP (VBP smell) (S (VP (TO to) (VP (VB repel) (NP (NNS predators)))))) (. .)))
When in danger, the osmeterium, which looks like a snake's tongue, everts and releases a foul smell to repel predators.
(ROOT (S (NP (NNS Snakes)) (VP (VBP use) (NP (PRP$ their) (NN tongue)) (PP (TO to) (NP (NN smell) (NNS things)))) (. .)))
Snakes use their tongue to smell things.