16.11. Sling Assemblers

The Sling parser needs assemblers for each of its allowable commands and for each base element of the language. The base elements include numbers, variables, pi, the sliders s1 and s2, negation, and the Sling functions. A single function assembler suffices to assemble all the different types of functions in Sling except for scale.

The scale function requires a special assembler because internally a Scale object takes five parameters in its constructor, and the Sling language allows for only two arguments in the scale function. The Sling parser always sets the first three parameters of a Scale object to 0, t, 1.

The three command assemblers needed by the environment are for the plot command, assignment command, and for ...

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.