16.4. Building the Sling Environment

The remainder of this chapter covers how to implement an imperative language, focusing on Sling for its examples. The internal representation of an imperative language script is a command. The following two sections cover

  • Building commands

  • Sling commands

Imperative languages often allow the user to create new functions, such as cartesian(x, sin(4*x)). A pair of sections cover

  • Building runtime functions

  • Sling functions

After showing you how to capture Sling commands and functions, this chapter wraps up with a discussion of the Sling target class and covers the remaining tasks for building a Sling parser:

  • Write a grammar.

  • Write assemblers to build Sling commands.

  • Generate a Sling parser from the grammar, plugging ...

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.