January 2013
Intermediate to advanced
328 pages
8h 5m
English
ANTLR has three great token-related features that are worth demonstrating in our tour. First, we’ll see how to deal with formats like XML that have different lexical structures (inside and outside tags) in the same file. Next, we’ll learn how to insert a field into a Java class by tweaking the input stream. It’ll show how to generate output that is very similar to the input with minimal effort. And, lastly, we’ll see how ANTLR parsers can ignore whitespace and comments without having to throw them out.
All the sample input files we’ve seen so far contain a single language, but there are common file formats that contain multiple languages. For example, the ...
Read now
Unlock full access