Skip to main content

Interpreter

  • Chapter
  • First Online:
Design Patterns in Modern C++
  • 4191 Accesses

Abstract

The goal of the Interpreter design pattern is, you guessed it, to interpret input, particularly textual input, although to be fair it really doesn’t matter. The notion of an Interpreter is greatly linked to Compiler Theory and similar courses taught at universities. Since we don’t have nearly enough space here to delve into the complexities of different types of parsers and whatnot, the purpose of this chapter is to simply show some examples of the kinds of things you might want to interpret.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Tlön is a toy language that I built to demo the idea of “if you don’t like existing languages, build a new one.” It uses Boost.Spirit and cross-compiles (transpiles) into C++. It is open-source and can be found at https://github.com/nesteruk/tlon

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Dmitri Nesteruk

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Nesteruk, D. (2018). Interpreter. In: Design Patterns in Modern C++. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-3603-1_15

Download citation

Publish with us

Policies and ethics