Chapter 30

Regular Expressions and Context-Free Parsers

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 one exception to this was using the built-in parser to deal with files that were formatted in EXtensible Markup Language (XML). In this chapter we will learn about some of the formal approaches that computer scientists have developed to deal with parsing text. These will ...

Get Introduction to the Art of Programming Using Scala now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.