O'Reilly logo

Building Parsers with Java™ by Steven John Metsker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

1.2. What Is a Language?

For the purposes of this book, a language is a set of strings. For example,

{"Hello, World."}

is a very little language. Another little example is the following:

{"", "a", "aa", "aaa", ...}

This language is the set of strings of zero or more as. The description of this set uses “...” to mean that the initial pattern continues. The strings that make up a language are the elements of that language. A parser is an object that recognizes the elements of a language. Most of the parsers in this book also build an object as the result of recognizing a language element.

Interesting languages usually contain strings that follow a certain pattern and are related in some way. For example, the following well-known languages are ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required