ABSTRACT

Parsing text is a task that comes up in a lot of different programs, whether it is pulling data out of text files, dealing with user commands, evaluating formulas, or understanding programming languages, some form of processing is typically needed when dealing with text values. Our approach to this so far has been fairly ad hoc. When faced with a particular format of input, we have written specialized code to handle it. The two exceptions to this were using the built-in parser to deal with files that were formatted in XML and the library parser for JSON, both of which are standard text formats. In this chapter we will learn about some of the formal approaches that computer scientists have developed to deal with parsing text. These will give you the ability to deal with more complex forms of text input in fairly easy, standard, and flexible ways.