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

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