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

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