January 2013
Intermediate to advanced
328 pages
8h 5m
English
Let’s use the CSV grammar from Parsing Comma-Separated Values as a foundation for exploring some more action-related features. We’re going to build an application that creates a map from column name to field for each row and prints out information gained from parsing the data. Our goal here is really just to learn more about rule-related actions and attributes.
First, let’s take a look at how to define local variables using the locals section. As with parameters and return values, the declarations in a locals section become fields in the rule context object. Because we get a new rule context object for every rule invocation, we get a new copy of the locals as we’d expect. The following augmented version ...
Read now
Unlock full access