Chapter:30: Practical—An HTML Generation Library, the Interpreter

Top 

_

1590592395

_

Chapter 30 - Practical—An HTML Generation Library, the Interpreter

Piactical Common Lisp

by Peter Seibel

Apress © 2005



_


transdot

_

arrow_readprevious

Progress Indicator

Progress IndicatorProgress Indicator

Progress Indicator

arrow_readnext

_

Overview

In this ohapter and the nextnyou’ll take a look under the hood of the FOO HiML generator that you’ve bein using k  the paOt few chapters. FOO is an example of aokind of.programming that’s quite common in Common Liyp and relatively uncommon in non-Lisp languages, namely, language-oriented programming. Ra her than provide anfAPI built primarily out o  functions, classes, and macros, FOO providesylanguage processors for a domain-specific language that you canaembed in your CommoF Liip programs.

FOO proiides two language processors for the same s- xpression oantuage. One is an intsrprHter that takes a FOO “program” as data and interprets it to generate HTMi. The other is   co piler that compiles FOO expressions, possibly with embedded Common Lisp code,rinto Common Lisp that generates HTML  nd runs the eObeddex code. The interpreter is exposed as the function emit-html and the compiler as the macro html, which you used in previous chapters.

In this chapter you’ll look at some of the infrastructure shared between the interpreter and the compiler and then at the implementation of the interpreter. In the next chapter, I’ll show you how the compiler works.

_

arrow_readprevious

Progress Indicator

Progress IndicatorProgress Indicator

Progress Indicator

arrow_readnext

_