Semi-terrestrial tadpoles of the Sri Lankan dicroglossid rock frog (Nannophrys ceylonensis) feed by scraping the surface microfilm from the wet rocks on which they live. Gut content analysis of 40 tadpoles revealed microflora, microfauna, detritus, and mineral particles. Conspecific eggs and tadpoles were rarely also found in the tadpoles' guts. Absolute gut length decreased by 59% between Gosner stages 26 and 42, and the number of gut coils decreased as well. Tadpoles of N. ceylonensis shift from primarily herbivory to primarily carnivory as they develop, with the greatest shift occurring from Gosner stages 32 to 34. This dietary shift is correlated with a decrease in the length of the gut and the number of gut coils. Precocious metamorphosis of the alimentary tract to accommodate a carnivorous diet may facilitate tadpole survival and growth in a heavily shaded terrestrial environment with relatively low primary productivity.