January 2013
Intermediate to advanced
328 pages
8h 5m
English
In the previous chapter, we learned how to embed actions within a grammar in order to execute application-specific code on-the-fly during the parse. Those actions did not affect the operation of the parser in any way, much as log statements do not affect the surrounding program. Our embedded actions just computed values or printed things out. In rare cases, however, altering the parse with embedded code is the only way to reasonably recognize the input sentences of a language.
In this chapter, we’re going to learn about special actions, {...}?, called semantic predicates that let us selectively deactivate portions of a grammar at runtime. Predicates are Boolean expressions that have the ...
Read now
Unlock full access