Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

3 Behavioral Patterns > Interpreter Pattern

Interpreter Pattern

What Is an Interpreter Pattern?

The Interpreter pattern interprets language elements into code solutions. Interpreters can be used for various purposes including handling regular expressions or reading flat files to interpret metadata into code. Generally, if you have some language or textual data that you need to deal with as a code process, you might use an interpreter to convert the data into a code-recognizable form.

The Interpreter pattern has two main components associated with it: the Context and the Expression. The context acts as a current data context, defining the language data as it is before the interpretation. The expression component contains the logic to convert a particular context into a code-readable form.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint