Islands in the Stream
The input files we’ve discussed so far all contain a single language. For example, DOT, CSV, Python, and Java files contain nothing but text conforming to those languages. But, there are file formats that contain random text surrounding structured regions or islands. We call such formats island languages and describe them with island grammars. Examples include template engine languages such as StringTemplate and the LaTeX document preparation language, but XML is the quintessential island language. XML files contain structured tags and & entities surrounded by a sea of stuff we don’t care about. (Because there is some structure between the tags themselves, we might call XML an archipelago language.)
Classifying something ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access