A parser is a program that reads a piece of text and produces a data structure that reflects the structure of the program contained in that text.