... is a Programming Environment (PE)?... is Generic Language Technology (GLT)?

Similar documents
What is a language? Eclipse IMP: ... is Generic Language. Technology (GLT)? What is a Program Generator?

Renaud Durlin. May 16, 2007

Spoofax: An Extensible, Interactive Development Environment for Program Transformation with Stratego/XT

SERG. Spoofax: An Extensible, Interactive Development Environment for Program Transformation with Stratego/XT

Chapter 1. Formatting with Box and Pandora

RLSRunner: Linking Rascal with K for Program Analysis

Rascal: A DSL for SCAM

Research Issues in the Renovation of Legacy Systems

How to make a bridge between transformation and analysis technologies?

SEN. Software Engineering. Software ENgineering. A type-driven approach to concrete meta programming. J.J. Vinju

Disambiguation Filters for Scannerless Generalized LR Parsers

Research Issues in the Renovation of Legacy Systems

Disambiguation Filters for Scannerless Generalized LR Parsers

Disambiguation Filters for Scannerless Generalized LR Parsers

Semantics driven disambiguation A comparison of different approaches

An Evaluation of Domain-Specific Language Technologies for Code Generation

Data Reverse Engineering using System Dependency Graphs

Generalized Parsing and Term Rewriting: Semantics Driven Disambiguation

Pretty-Printing for Software Reengineering

sbp: A Scannerless Boolean Parser

UPTR - a simple parse tree representation format

Introduction to Compiler Construction

9/5/17. The Design and Implementation of Programming Languages. Compilation. Interpretation. Compilation vs. Interpretation. Hybrid Implementation

Stratego: A Language for Program Transformation Based on Rewriting Strategies

Domain-Specific Languages versus Object-Oriented Frameworks: A Financial Engineering Case Study. 1 Introduction. A. van Deursen

Introduction to Compiler Construction

ATERMs for manipulation and exchange of structured data: it s all about sharing

c 2002 Published by Elsevier Science B. V. Open access under CC BY-NC-ND license.

The Meta-Environment. A Language Workbench for Source code Analysis, Visualization and Transformation. Jurgen Vinju IPA herfstdagen 2008

Domain-Specific Languages for Digital Forensics

Thermodynamics of computation and information distance

HASDF: A Generalized LR-parser Generator for Haskell. Merijn de Jonge, Tobias Kuipers, and Joost Visser

A Language Development Environment for Eclipse

Scannerless Boolean Parsing

EASY Programming with Rascal

Model driven Engineering & Model driven Architecture

University of Amsterdam Programming Research Group

The Rascal meta-programming language a lab for software analysis, transformation, generation & visualization

COP4020 Programming Languages. Compilers and Interpreters Robert van Engelen & Chris Lacher

Faster Scannerless GLR Parsing

Grammar Composition & Extension

PRINCIPLES OF COMPILER DESIGN UNIT I INTRODUCTION TO COMPILING

M : an Open Model for Measuring Code Artifacts

Code Transformation by Direct Transformation of ASTs

Domain-Specific Languages for Composable Editor Plugins

Domain-Specific Languages for Composable Editor Plugins

Compiling and Interpreting Programming. Overview of Compilers and Interpreters

COMP-421 Compiler Design. Presented by Dr Ioanna Dionysiou

Book. Signatures and grammars. Signatures and grammars. Syntaxes. The 4-layer architecture

Eclipse Support for Using Eli and Teaching Programming Languages

Token Interception for Syntax Embedding

SERG. Domain-Specific Languages for Composable Editor Plugins

Downloaded from UvA-DARE, the institutional repository of the University of Amsterdam (UvA)

Rscript: a Relational Approach to Program and System Understanding

Pioneering Compiler Design


Product Line Evolution Using Source Packages

Formats of Translated Programs

Compiling Regular Expressions COMP360

Compiler Design. Computer Science & Information Technology (CS) Rank under AIR 100

COMPILER DESIGN. For COMPUTER SCIENCE

2 The ASF+SDF Meta-environment [Kli93] is an example of a programming environment generator. It is a sophisticated interactive environment for the dev

The PISA Project A Model Driven Development case study

Centrum voor Wiskunde en Informatica. A Pretty-Printer for Every Occasion. M. de Jonge. Software Engineering (SEN)

Semantics driven disambiguation

Automating Feature-Oriented Domain Analysis

A Relational Calculus Approach to Software Analysis

Compilers Project Proposals

SERG. Natural and Flexible Error Recovery for Generated Modular Language Environments

Object-Oriented Pattern-Based Language Implementation

Introduction to Compiler Construction

APPLYING OBJECT-ORIENTATION AND ASPECT-ORIENTATION IN TEACHING DOMAIN-SPECIFIC LANGUAGE IMPLEMENTATION *

Verifiable composition of language extensions

CS426 Compiler Construction Fall 2006

Introduction. Compilers and Interpreters

What do Compilers Produce?

Introduction to Dependable Systems: Meta-modeling and modeldriven

In [18] REFINE [23] is used, while we use the ASF+SDF Meta-Environment [15]. Those systems are related. Organization In Section 2 we describe the idea

Faster Scannerless GLR Parsing

SPIN s Promela to Java Compiler, with help from Stratego

LECTURE 3. Compiler Phases

Grammars and Parsing. Paul Klint. Grammars and Parsing

Language Translation. Compilation vs. interpretation. Compilation diagram. Step 1: compile. Step 2: run. compiler. Compiled program. program.

Introduction to Compiler Construction

An action compiler targeting Standard ML

Introduction to Compiler Construction

Type Inference for COBOL Systems

Strategies in PρLog. Temur Kutsia. RISC, JKU Linz, Austria

Technical aspects of VTL to SQL translation Prepared by Regional Statistical Office in Olsztyn, Poland

General Concepts. Abstraction Computational Paradigms Implementation Application Domains Influence on Success Influences on Design

CST-402(T): Language Processors

Domain-specific languages with custom operators

A Comparison of Configuration Techniques for Model Transformations

DSL Design. Overview of DSLE. DSL Design. DSL Desing. Domain specific languages

A Survey on Domain-Specific Languages in Robotics

CSE450. Translation of Programming Languages. Lecture 11: Semantic Analysis: Types & Type Checking

List of Figures. About the Authors. Acknowledgments

ToolBus: The Next Generation


Term Rewriting with Traversal Functions

Transcription:

Introduction to Generic Language Technology Today Mark van den Brand Paul Klint Jurgen Vinju Tools for software analysis and manipulation Programming language independent (parametric) The story is from the IDE/PE perspective First a general overview, then introduction to specific technologies 1 2 What... What... 3 4

What is a Language? Aspects of a Language A programming language Syntax Assembler, Cobol, PL/I, C, C++, Java, C#,... ual form of declarations, statements, etc. A Domain-Specific Language (DSL) Static Semantics SQL for queries BibTex for entries in a bibliography Euris for railroad emplacement safety Risla for financial products Scope and type of variables, conversions, formal/actual parameters, etc. Queries: who calls who, who uses variable X,... Dynamic Semantics Program execution 5 6 What... What is a Programming Environment? A system that supports the development of programs in order to: Increase productivity: Uniform user-interface (UI); integrated tools Increased interaction; early error detection Increase quality: Integrated version management Integrated testing Integrated documentation 7 8

Classical PE Integrated PE (IPE) also: Integrated Development Environment (IDE) editor only Specialized, syntax-directed, editor for each language Programs stored in files Common intermediate representation for all tools Complete recompilation after each change Late error detection Debugging requires recompilation with different options Example: xemacs or vim gcc or javac Incremental processing (reusing results of previous calculations) One GUI Early error detection Syntax errors Undeclared variables Type errors in expressions 9 10 Functionality of an IPE Simple, External, View of IPE Syntax-directed editing/highlighting, pretty printing Typechecking Restructuring Versioning Executing, debugging, profiling Testing Documenting Edit Commands Error Messages Values Integrated Programming Environment 11 12

Simple, Internal, View of IPE Examples of IPEs Eclipse: www.eclipse.org Edit Commands Error Messages parser editor pretty printer type checker Syntax Tree Manager Integrated Development Environment (IDE) for Java Plug-in mechanism for extensions MS Visual Studio: msdn.microsoft.com/vstudio IDE for various languages VB, C, C++, C# Values evaluator 13 14 What... What is Generic Language Technology? Goal: Enable the easy creation of languagespecific tools and programming environments Separate language-specific aspects from generic aspects Approach: Find good, reusable, solutions for generic aspects Find ways to define language-specific aspects Find ways to generate tools from language-specific definitions 15 16

User-interface editor Program storage Documentation Generic aspects Defining Language Aspects Syntax Lexical and context-free grammar Static semantics Algebraic specification/rewrite rules Dynamic semantics Algebraic specification/rewrite rules 17 18 From Definition to Tool Examples of Generic IPEs Syntax Eclipse IMP: http://eclipse-imp.sourceforge.net/imp.html Scanner and parser generation Static semantics Term rewriting Dynamic semantics Term rewriting A framework for Generic Integrated Development Environments (IDE) The goal of the Eclipse IMP is to provide an extensible platform for the development of highquality, fully-featured, language-specific IDE's in Eclipse. 19 20

What... What is a Program? Definition of problem P Generated program that solves P 21 22 Examples of Program s (1) Examples of Program s (2) Regular expression matching: Problem: recognize regular expressions R 1,..., R n in a text Generates: finite automaton Web sites Problem: create uniform web site for set of HTML pages Generate: HTML code with standard layout and site map 23 Generate bibliographic entries; input @article{bjko00, author = {Brand, {M.G.J. van den} and Jong, generates: title journal {H.A. de} and P. Klint and P. Olivier}, = {{E}fficient {A}nnotated {T}erms}, = {Software, Practice \& Experience}, year = {2000}, pages = {259--291}, volume = {30}} M.G.J. van den Brand, H.A. de Jong, P. Klint and P.A. Olivier, Efficient Annotated Terms, Software, Practice & Experience, 30(3):259 291, 2000 24

Examples of Program s (3) Compiler: Input: Java program Generates: JVM code C preprocessor: Input C program with #include, #define directives Generates C program with directives replaced. Program s (summary) Problem description is specific and is usually written in a Domain-Specific Language (DSL) contains generic algorithms and information about application domain. A PG isolates a problem description from its implementation easier to switch to other implementation methods. Improvements/optimizations in the generator are good for all generated programs. 25 26 What... What is a Programming Environment (PEG)? A PEG is a program generator applied in the domain of programming environments Input: description of a desired language L Output: (parts of) a dedicated L environment Advantages: Uniform interface across different languages contains generic, re-usable, implementation knowledge Disadvantage: some UI optimizations are hard 27 28

Programming Environment PEG = collection of program generators Formal definition of language L Definition of L syntax Definition of L static semantics Definition of L dynamic semantics Parser Typechecker Evaluator Dedicated environment for editing, manipulating and executing L programs L-parser L-typechecker L-evaluator Integrated L-programming environment 29 30 From Definitions to Components PEG: further definitions Syntax Definition Lexical syntax Program Analysis parser Concrete syntax Program Queries Edit Commands Error Messages Values editor pretty printer type checker evaluator Syntax Tree Manager Static Semantics Abstract syntax Pretty printing Editor behaviour Dataflow Control flow Evaluation rules Compilation rules User Interface Help rules... Dynamic Semantics 31 32

ASF+SDF Meta-Environment (1) An interactive development environment for generating tools from formal language definitions Based on: Full context-free grammars Conditional term rewriting Language definitions written in ASF+SDF SDF: Syntax definition Formalism ASF: Algebraic Specification Formalism ASF+SDF Meta-Environment (2) Interactive Development Environment for Language definitions Stand-alone, generated, environment ASF+SDF Meta-Environment Formal definition of language L Generated L programming environment 33 34 Summary Generic Language Technology helps to build tools for language processing quickly Programming Environment s are an application of GLT The ASF+SDF Meta-Environment is an Interactive Development Environment for language definitions and a Programming Environment Further reading (1) technology J. Heering and P. Klint, Rewriting-Based Languages and Systems, Chapter 15 in Terese, Term Rewriting Systems, Cambridge University Press, 2003 M.G.J. van den Brand, J. Heering, P. Klint and P.A. Olivier, Compiling language definitions: The ASF+SDF compiler. ACM Transactions on Programming Languages and Systems, 24 (4):334-368, July 2002 M.G.J. van den Brand, A. van Deursen, J. Heering, H.A. de Jong, M. de Jonge, T. Kuipers, P. Klint, L. Moonen, P.A. Olivier, J. Scheerder, J.J. Vinju, E. Visser, and J. Visser, The ASF+SDF Meta-Environment: a Component-Based Language Development Environment. in: R. Wilhelm (ed). Proceedings of Compiler Construction (CC'01), LNCS 2027, 365--370, 2001. M.G.J. van den Brand, H.A. de Jong, P. Klint and P.A. Olivier, Efficient Annotated Terms, Software, Practice & Experience, 30(3):259--291, 2000 J. A. Bergstra and P. Klint, The discrete time ToolBus -- a software coordination architecture, Science of Computer Programming 31(2-3):205-229, 1998 35 36

Further reading (2) application areas A. van Deursen, P. Klint and J. Visser. Domain-Specific Languages: An Annotated Bibliography ACM SIGPLAN Notices 35(6):26-36, June 2000. M.G.J. van den Brand, P. Klint and C. Verhoef, Reverse Engineering and System Renovation: an Annotated Bibliography, ACM Software Engineering Notes, 22(1): 42--57, January 1997. M.G.J. van den Brand, A. van Deursen, P. Klint, S. Klusener, E.A. van der Meulen, Industrial Applications of ASF+SDF, In M. Wirsing and M. Nivat (eds) Proceedings of Algebraic Methodology and Software Technology (AMAST'96), LNCS Vol. 1101, 9-18, 1996. See: www.meta-environment.org 37