16.9. Sling Target

As a Sling parser recognizes an input program, it must build a composite command that represents the program. Assembler subclasses do the work of building this command, sharing certain objects during parsing. The assemblers use a target object to contain the common objects the assemblers need while parsing a Sling program. The target is a single object of class SlingTarget containing a scope, two sliders, and a RenderableCollection object. The assemblers update the target and leave one or more Command objects on the assembly's stack. Figure 16.27 shows the SlingTarget class.

Figure 16.27. The SlingTarget class. An instance of SlingTarget holds objects that the environment's assemblers refer to while constructing a command that ...

Get Building Parsers with Java™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.