O'Reilly logo

Building Parsers with Java™ by Steven John Metsker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required