Meta generation of syntax oriented editors

Similar documents
PRINCIPLES OF COMPILER DESIGN UNIT I INTRODUCTION TO COMPILING

SILVACO. An Intuitive Front-End to Effective and Efficient Schematic Capture Design INSIDE. Introduction. Concepts of Scholar Schematic Capture

Chapter 3. HDL Editor. Introduction. Figure 3-1. HDL Editor Welcome Screen. Introduction 3-1

Consider a description of arithmetic. It includes two equations that define the structural types of digit and operator:

Extracting the Range of cps from Affine Typing

Chapter 3: CONTEXT-FREE GRAMMARS AND PARSING Part 1

TeXnicCenter v1 Beta Frank Van Puyvlde ICT for Research K.U.Leuven

Design Pattern. CMPSC 487 Lecture 10 Topics: Design Patterns: Elements of Reusable Object-Oriented Software (Gamma, et al.)

CSCE 314 Programming Languages

The Structure of a Syntax-Directed Compiler

SEM / YEAR : VI / III CS2352 PRINCIPLES OF COMPLIERS DESIGN UNIT I - LEXICAL ANALYSIS PART - A

Lexical Scanning COMP360

News in RSA-RTE CP1

IBM Rational Rhapsody Gateway Add On. User Manual

Business Insight Authoring

Concept as a Generalization of Class and Principles of the Concept-Oriented Programming

OpenForms360 Validation User Guide Notable Solutions Inc.

2 Getting Started. Getting Started (v1.8.6) 3/5/2007

IBM Rational Rhapsody Gateway Add On. User Guide

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

Proceedings of the Second International Workshop on Layout of (Software) Engineering Diagrams (LED 2008)

Getting Started. Custom Reports Software

Parsing Combinators: Introduction & Tutorial

Theory and Compiling COMP360

Lectora Video Editor Information Center

Installation & Operating Instructions Macro Naming Version 1.0

MICROSOFT Excel 2010 Advanced Self-Study

Type vs Style. Interaction types what is the aim of the interaction? Interaction styles what mechanism is to be used? E.g.

Automatic Generation of Graph Models for Model Checking

flex is not a bad tool to use for doing modest text transformations and for programs that collect statistics on input.

SkyEyes: A Semantic Browser For the KB-Grid

Unlike other computer programs you may have come across, SPSS has many user

Lecture 10 Parsing 10.1

The analysis part breaks up the source program into constituent pieces and creates an intermediate representation of the source program.

MAPILab Statistics for SharePoint User Guide

Tetra4D Reviewer. Version 5.1. User Guide. Details on how to use Tetra4D Reviewer.

Prototype User Guide Public Release Version 1

3 TUTORIAL. In This Chapter. Figure 1-0. Table 1-0. Listing 1-0.

Getting Started (1.8.7) 9/2/2009

The Pipeline Lab Copyright Bluespec Inc

Extended Dataflow Model For Automated Parallel Execution Of Algorithms

Chapter 4. Syntax - the form or structure of the expressions, statements, and program units

42 Editing MSC Diagrams

New Programming Paradigms

Zend Studio 3.0. Quick Start Guide

WPS Workbench. user guide. "To help guide you through using the WPS user interface (Workbench) to create, edit and run programs"

A Top-Down Visual Approach to GUI development

MindView Online - Quick Start Guide

Building Compilers with Phoenix

CHAPTER 1 COPYRIGHTED MATERIAL. Finding Your Way in the Inventor Interface

NPTEL Computer Science and Engineering Human-Computer Interaction

VIVA QUESTIONS WITH ANSWERS

Working with the RTF Generator

Lesson 1: Getting Familiar with Microsoft Word 2007 for Windows

BasicScript 2.25 User s Guide. May 29, 1996

A simple syntax-directed

What can Word 2013 do?

At the shell prompt, enter idlde

AADL Graphical Editor Design

Prof. Mohamed Hamada Software Engineering Lab. The University of Aizu Japan

Our initial reason for creating a CMS was for accessibility reasons.

Lectora Audio Editor Information Center

Principles of Programming Languages COMP251: Syntax and Grammars

Single Menus No other menus will follow necessitating additional user choices

Reference Manual and License Agreement

TopMill TopTurn. Jobshop Programming & Simulation for Multi-Side & Complete Mill-Turn Machining for every CNC Control

Indexing into Controlled Vocabularies with XML

Chapter 3. Describing Syntax and Semantics

LexisNexis CD. on Folio 4. User s Guide

A Guided Tour of Doc-To-Help

Learning About Technology. The Desktop (cont'd) The Desktop. Playing Recorded Music

Flow Computer. Manual Configuration of Device Software. FC1-CDS-EN b i From ensuite version 3.4

The Turing Environment

2. Reachability in garbage collection is just an approximation of garbage.

CROMWELLSTUDIOS. Content Management System Instruction Manual V1. Content Management System. V1

GOMS Lorin Hochstein October 2002

The new layer will be part of the template because we want it to appear alongside the nav bar on every page.

Introduction to Syntax Analysis. Compiler Design Syntax Analysis s.l. dr. ing. Ciprian-Bogdan Chirila

AutoCAD 2009 User InterfaceChapter1:

EVE WORKSHOP A practical introduction to the Extensible VAX Editor (2nd Edition)

Using nu/tpu on UNIX Last revised: 1/28/00

Microsoft Word 2007 on Windows

More On Syntax Directed Translation

Interaction Style Categories. COSC 3461 User Interfaces. Windows. Window Manager

Introduction to Microsoft Office 2016: Word

Chapter 10 Implementing Subprograms

An Object Model for Multiparadigm

Atelier B. Model Editor. User Manual. version 3.1


Simulating Task Models Using Concrete User Interface Components

Verilog Design Entry, Synthesis, and Behavioral Simulation

Specifying Syntax. An English Grammar. Components of a Grammar. Language Specification. Types of Grammars. 1. Terminal symbols or terminals, Σ

Productivity! Feature Matrix

Syntactic Directed Translation

CSE 3. The Desktop. Learning About Technology. Playing Recorded Music. The Desktop (cont'd)

CSE 3. Learning About Technology. Comics Updates U2 puzzle Shortcut(s) of the day Ch 1-2, How Computers Work Textbook wrong:

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

Syntax Analysis/Parsing. Context-free grammars (CFG s) Context-free grammars vs. Regular Expressions. BNF description of PL/0 syntax

Managing Your Website with Convert Community. My MU Health and My MU Health Nursing

Visual Studio.NET. Although it is possible to program.net using only the command OVERVIEW OF VISUAL STUDIO.NET

Transcription:

Computer Science Journal of Moldova, vol.3, no.1(7), 1995 Meta generation of syntax oriented editors N.Shvets K.Chebotar Abstract A method for automatic generation of syntax-oriented editors (SOE) for high level programming languages is presented. It is based on a special template definition metalanguage. The SOE functional environment including the operations with source files and internal representation of the programs in form of abstract syntax tree was implemented as an independent modular structure. As a result of target language metadescription processing the SOE for this language is generated by a special preprocessor. Depending on user s experience level (novice, advanced, etc.), generation of various SOE for the same language by changing a level of descriptions of phrases and templates is also possible. Introduction Syntax oriented editor (SOE) is a tool for program development based on hierarchical structure of the high level programming languages (HLPL) [1 3]. Its design pursues a few goals. Primarily, its purpose is to increase the users labour productivity and to guarantee a minimal level of errors when typing the text of a program. Secondly, it may be used for tutoring if designed properly. There are some related aspects, too. Both main goals are achieved by automatic expansion the HLPL metaconcepts marked by the user and due to the presence of operations on structured texts and operations delivering an additional information about the language to the users who are not familiar with it. The most important thing is that all these operations do not depend on the language factually and that the minimal level of errors c 1995 by N.Shvets, K.Chebotar 3

N.Shvets, K.Chebotar can be regulated.by the appropriate organization of the editor even graphical languages can be treated, too [3]. All this is achieved easily if the information necessary for SOE functioning may be extracted immediately (and automatically) from the common syntax description (metasyntax) of the language. Under these conditions we get the SOE generator which gives possibility to work uniformly with any HLPL in the editor environment when it is provided with an algorithm processing the metadescriptions mentioned. 1 The HLPL preprocessing The aim of preprocessing is to build informational tables controlling the SOE, from the target language definition in terms of a special metalanguage. The latter is based on BNF ( Backus normal forms) and is called the template definition language (TDL). Besides information which is characteristic for BNF, the metalanguage includes some additional data, namely: quantitative data for quick and convenient generation and use of the tables metaconcepts characteristics data used to visualize the program being generated. Metaconcepts characteristics are: type (template is an intermediate concept, phrase is a terminal one) kind ( simple template, template option, templates lists of two sorts). The terminal metaconcepts possessing simple structure are being typed, as a rule, by the user on the display. Their level may be controlled by means of metalanguage. After processing it we can have different tables for the same programming language, controlling the 4

Meta generation of syntax oriented editors speed of the program generation and minimal level of errors, simultaneously. So, if a concrete language and a level of phrases are fixed, the tables obtained may be considered as parameters and then the simple SOE becomes a parameterized one. The syntactic tables being a result of preprocessing, are represented by files. One of them is a set of records containing full information about the structure of each template and relations between the templates (for quick search). The other is a set of strings representing metaconcepts names and separators. One more file formed as part of preprocessing contains texts specifying the structure of the standard functions calls and standard identifiers. These files, besides providing the correct functioning of SOE, are used to supply a user novice with additional information about the language structure (help services). The structure of TDL is the following: language metadescription ::= number of metaconcepts metaconcept description number of metaconcepts ::= integer metaconcept description ::= numeric information metaconcept name metaconcept structure numeric information ::= template numeric description screen layout descriptions numeric template description ::= number of alternatives number of components number of sons number of screen layout descriptions number of alternatives ::= integer number of components ::= integer number of sons ::= integer number of screen layout descriptions ::= integer screen layout descriptions ::= template layout... template layout template layout ::= component layout... component layout component layout ::= line shift column shift line shift ::= 0 1 column shift ::= 0 integer 5

N.Shvets, K.Chebotar metaconcept structure ::= component description...... component description component description ::= component type component kind component type ::= simple component option list simple component ::= ( option ::= [ list ::= # component kind ::= keyword phrase template keyword ::= K string of keywords and separators phrase ::= F metaconcept name template ::= T metaconcept name metaconcept name ::= identifier 2 SOE functioning The work done by the SOE is the following: 1. operations on files such as viewing text file reducing it to the abstract syntax tree creating a new file for program generation calling an old file containing the result of the previous editing session formatting the texts represented in free format 2. setting the mode of SOE functioning: autosave period selection saving history of the session setting the depth of the stack of operations 3. structured program generation/editing 4. unstructured program editing 5. quitting the editor under the following requests: to save the intermediate result generation to generate the program in terms of target language 6

Meta generation of syntax oriented editors to confirm the exit or to return to the editor environment. As all systems of the kind, the SOE program is menu driven. The main menu and its submenues used in SOE correspond to the operations mentioned. After setting the mode of functioning and the initial file choice all the work is done in the editor environment (item 3). This work has a visible part (the SOE user interface: screen, cursor) and an internal one. Invisible for the user, the second part is based on the program representation known as abstract syntax tree (AST). It is used to implement the screen interface, relating cursor movements with the program text and allowing in this way the basic operations application. A linear representation of the AST is designed for saving an intermediate (not finished)program in a file. The initial visible object being the object for processing when a program is being generated/edited, is the virtual screen created as a result of a file choice. Relations with the syntax tree vertices corresponding to the current state of the screen are set through two types of a cursor: the normal cursor and the structural one. The normal cursor may be replaced by the mouse to accelerate access to a node. The structural cursor goes through empty (not yet generated ) nodes and inserted ones (to make the latter visible if they are not hidden) by the users request. Empty nodes are highlighted and nonempty ones are marked by the normal cursor. Two basic actions applied to the program text in the editor environment are node generation and editing. Node generation (or insertion ) occurs for simple templates immediately, and for alternatives it is preceded by the corresponding menu displaying. Every insertion causes the related window setting and cursors movements correspond further to the coordinates of the window. The final insertion returns the resulting screen state. Exit from the window with some nongenerated nodes may return the screen to the initial state. For the case the special operation is introduced to renew the screen by the user s desire. Phrase generation is done by typing the appropriate text, as it was mentioned above. There is an operation for phrases selection from those 7

N.Shvets, K.Chebotar introduced before. Analysis of the phrase syntax is done immediately after phrase generation. The number of sons for the templates lists is unknown in advance and is determined during the process of generating/editing the program. To create new node as list element there exist a special operation requesting if it is subsequent or previous to the current one. The same is done for the templates options: they are present on the screen, but may be generated or suppressed by desire of the user. A special operation is introduced to restore them. Node editing is made by means of operations mark, copy, delete, move. A stack of nodes is used to restore the structure of a program in the case of erroneous deleting or moving the subtree during the current session. Its depth may be regulated by the user. The other kind of editing implemented as independent work and called after the program has been generated, is based on two simple operations on strings characteristic for the text editors, namely, cut and paste. It serves for the purposes of displaying the text of the final program in the manner preferable by the user. To minimize the size of the final program text on the screen, the operation of packing / unpacking is introduced (the hidden nonempty nodes appear and disappear). Comments are generated as phrases options. A few words are to be said about controlling the speed of program generation. There is a correlation between the level of the user and the degree of detail of metaconcepts. For experienced programmers the latter may be diminished so that the maximal speed could be achieved. A special item in the main menu is present to edit the metadescription of a language and to generate the tables controlling the SOE functioning which are appropriate for this user. Conclusion The SOE structure described above isn t complete or closed. At the present time it is under implementation on the principles of object oriented programming more adequate for the description of the SOE 8

Meta generation of syntax oriented editors structure. It is supplemented by a number of other useful and convenient features (for example, context analysis of templates/phrases, parallel hierarchies of procedures and data declarations, more convenient screen interface etc.). It means that the similar SOE may be used as a base for integrated environments creation which allow passing from the program correct generation to the full syntax structure check up and to run intermediate programs (prototypes) in the process of the program development. References [1] M.V.Zelkowitz. A small contribution to editing with a syntax directed editor, ACM SIGSOFT SIGPLAN Symposium for Practical Software Development Environments, Pittsburgh, PA, April, 1984, p.1 6. [2] T.W.Reps, T.Teitelbaum. The synthesizer generator: a system for constructing language based editors. N.Y.: Springer Verlag, 1988. [3] V.Lextrait, X.Ceugniet. NEXUS: The meta generation of versatile graphical multi user structure editors using generalized attribute grammars. CHI9 Workshop on structure editors, Seattle, April 1990. N.Shvets, K.Chebotar, Received 13 April, 1995 Institute of Mathematics, Academy of Sciences of Moldova, 5 Academiei str., Kishinev, 277028, Moldova e mail: {22nata,chebotar}@math.moldova.su 9