Table Of ContentPraise for Software Language Engineering
“Kleppe provides a rewarding reading experience. She masterfully blends the valuable insights of
both academics and practitioners, and her holistic approach to the subject will benefit software engi-
neers with helpful insights into their craft and tools.”
—Patrick Bailey, Computer Science Department, Calvin College
“With the advent of domain-specific languages in modern software development, an understanding
of software language engineering becomes essential for developers. Kleppe offers an erudite and
easy-going introduction to the key concepts of the subject.”
—Anders Hessellund, IT University of Copenhagen, Denmark
“Ms. Kleppe has risen to the challenge by successfully combining the traditional theory of text-based
programming languages with the brave new world of computer modeling languages into a single
comprehensive and consistent conceptual framework. Furthermore, she has done so with wit and
style. The text is eminently readable without being condescending, and should please both pragmati-
cally inclined software developers as well as theoreticians who seek abstractions. This is a rare exam-
ple of a technical book that fully realizes the adage that ‘things should be made as simple as possible,
but no simpler.’”
—Bran Selic, Malina Software Corp.
“By finally gathering under one roof the philosophy, concepts, and terminology of language
design—and by breaking down many of the needless barriers between graphical and textual lan-
guages—this book provides a good introduction for the novice and is a useful refresher for the
expert.”
—Dr. Laurence Tratt, Bournemouth University, UK
“Software Language Engineering is an excellent resource for teaching you how to create software
languages that are specific to your domain by utilizing a domain modeling approach.”
—Dave Hendricksen, Software Architect
“Languages to define procedures, objects, and intent have proliferated unchecked since Ada Byron.
Lady Lovelace first realized in 1830 that some day machines would be programmed. The vast major-
ity of these languages have failed to feature much in the way of design, despite pioneering work by
computer scientists such as Niklaus Wirth. But if, as Wirth says, “... precision and perfection are not
a dispensable luxury, but a simple necessity,” then language design, in fact precise language design,
becomes a critical skill. The advent of general language-modeling languages (like Meta Object Facil-
ity) and languages designed to be made domain-specific (like Unified Modeling Language) make this
skill even more pressing. No one better understands these issues, or better presents a unified path to
precise language design, than Anneke Kleppe. Using clear and concise examples and detailed expla-
nations, this book gives the language designer (and in fact any architect or developer) the back-
ground, tools, and skills necessary to design general and domain-specific languages right, the first
time. It belongs on the bookshelf of every systems architect and software developer.”
—Richard Mark Soley, Ph.D., Chairman and CEO, Object Management Group, Inc.
“In this book Anneke brings together the “old” knowledge of programming languages with the
“new” field of modeling languages. She makes it crystal clear how they complement each other
instead of how they compete with each other. I especially like the new term “mogram,” which is the
generic term for both model and program. Anyone who is designing or implementing programming
languages, modeling languages, or domain specific languages should read this book. It provides the
reader with the fundamental background on software language engineering.”
—Jos Warmer, Partner at Odina
Software Language
Engineering
This page intentionally left blank
Software Language
Engineering
Creating Domain-Specific
Languages Using Metamodels
Anneke Kleppe
Upper Saddle River, NJ • Boston • Indianapolis • San Francisco
New York • Toronto • Montreal • London • Munich • Paris • Madrid
Capetown • Sydney • Tokyo • Singapore • Mexico City
Many of the designations used by manufacturers and sellers to distinguish their products are claimed
as trademarks. Where those designations appear in this book, and the publisher was aware of a trade-
mark claim, the designations have been printed with initial capital letters or in all capitals.
The author and publisher have taken care in the preparation of this book, but make no expressed or
implied warranty of any kind and assume no responsibility for errors or omissions. No liability is
assumed for incidental or consequential damages in connection with or arising out of the use of the
information or programs contained herein.
The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or
special sales, which may include electronic versions and/or custom covers and content particular to your
business, training goals, marketing focus, and branding interests. For more information, please contact:
U.S. Corporate and Government Sales
(800) 382-3419
[email protected]
For sales outside the United States please contact:
International Sales
[email protected]
Visit us on the Web: informit.com/aw
Library of Congress Cataloging-in-Publication Data:
Kleppe, Anneke G.
Software language engineering : creating domain-specific languages
using metamodels / Anneke Kleppe. — 1st ed.
p. cm.
Includes bibliographical references and index.
ISBN: 0-321-55345-4 (paper back : alk. paper) 1. Programming
languages (Electronic computers) 2. Software engineering. 3. Computer
software—Development. I. Title.
QA76.7.K576 2008
005.1—dc22
Copyright © 2009 Pearson Education, Inc.
All rights reserved. Printed in the United States of America. This publication is protected by copy-
right, and permission must be obtained from the publisher prior to any prohibited reproduction, stor-
age in a retrieval system, or transmission in any form or by any means, electronic, mechanical,
photocopying, recording, or likewise. For information regarding permissions, write to:
Pearson Education, Inc
Rights and Contracts Department
501 Boylston Street, Suite 900
Boston, MA 02116
Fax (617) 671-3447
ISBN-13: 978-0-321-55345-4
ISBN-10: 0-321-55345-4
Text printed in the United States on recycled paper at Courier in Stoughton, Massachusetts.
First printing, December 2008
To my son Robert,
whom I love much more than my work.
This page intentionally left blank
Contents
Background Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvii
Chapter 1 Why Software Language Engineering?. . . . . . . . . .1
1.1 An Increasing Number of Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Software Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 The Changing Nature of Software Languages . . . . . . . . . . . . . . . . . . . . . 4
1.3.1 Graphical versus Textual Languages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3.2 Multiple Syntaxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.4 The Complexity Crisis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.5 What We Can Learn From ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.5.1 Natural-Language Studies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.5.2 Traditional Language Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.5.3 Graph Theory. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.6 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Chapter 2 Roles in Language Engineering. . . . . . . . . . . . . . .15
2.1 Different Processes, Different Actors. . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.2 The Language User. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.2.1 Tool Set of the Language User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
ix