A Computer Language Transformation System Capable of Generalized Context-Dependent Parsing

Total Page:16

File Type:pdf, Size:1020Kb

A Computer Language Transformation System Capable of Generalized Context-Dependent Parsing A Computer Language Transformation System Capable of Generalized Context-Dependent Parsing by Adrian D. Thurston A thesis submitted to the School of Computing in conformity with the requirements for the degree of Doctor of Philosophy Queen's University Kingston, Ontario, Canada December 2008 Copyright c Adrian D. Thurston, 2008 ISBN 978-0-494-46208-9 Abstract Source transformation systems are special-purpose programming languages, or in some cases suites of languages, that are designed for the analysis and transformation of computer lan- guages. They enable rapid prototyping of programming languages, source code renovation, language-to-language translation, design recovery, and other custom analysis techniques. With the emergence of these systems a serious problem is evident: expressing a parser for common computer languages is sometimes very difficult. Source transformation systems employ generalized parsing algorithms, and while these are well suited for the kind of agile parsing techniques in use by transformation practitioners, they are not well suited for pars- ing languages that are context-dependent. Traditional deterministic parser generators do not stumble in this area, but they sacrifice the generalized parsing abilities that transfor- mation systems depend on. When it is hard to get the input into the system as a correct and accurate parse tree the utility of the unified transformation environment is degraded and more ad hoc approaches become attractive for processing input. This thesis is about the design of a new computer language transformation system with a focus on enhancing the parsing system to support generalized context-dependent pars- ing. We argue for the use of backtracking LR as the generalized parsing algorithm. We present an enhancement to backtracking LR that allows us to control the parsing of an ambiguous grammar by ordering the productions of the grammar definitions. We add a i grammar-dependent lexical solution and integrate it with our ordered choice parsing strat- egy. We design a transformation language that is closer to general-purpose programming languages, yet enables common transformation techniques. We add semantic actions to our backtracking LR parsing engine and encourage the modification of global state in support of context-dependent parsing. We introduce semantic undo actions for reverting changes to global state during backtracking, thereby enabling generalized context-dependent parsing. Finally, we free the user from having to write undo actions by employing automatic reverse execution. The resulting system allows a wider variety of computer languages to be ana- lyzed. By focusing on improving parsing abilities and moving to a transformation language that resembles general-purpose languages, we aim to extend the transformation paradigm to allow greater use by practitioners who face an immediate need to parse, analyze and transform computer languages. ii Acknowledgements I would like to thank my supervisor, James R. Cordy, for guidance during the production of this work. Jim was always available for discussions that left me with a fresh perspective. He has an amazing ability to relate new ideas to the huge and rather intimidating body of research that we have behind us. His ability to articulate my ideas in a manner that inspires confidence in my own work proved invaluable to me. I would like to thank lab members Jeremy S. Bradbury and Chanchal K. Roy for many productive discussions about research and grad school life. I am aware that in a lifetime it is possible to pursue interests that are easily shared with those you love. Like many grad students, this was not the case with me. My interests lie far from those of my family, yet my family always supported my personal obsessions and distractions. I would especially like to thank them for their love and support in my final year. Nobody is forced to write a thesis, and completing one takes a lot of hard work. Persistence in this kind of situation requires support from people who are willing to sacrifice while you chase after your own goals. My family did just that, and it is one of the many reasons why I am forever indebted to them. iii Statement of Originality I hereby certify that the research presented in this dissertation is my own, conducted under the supervision of James R. Cordy. Ideas and techniques that are not a product of my own work are cited, or, in cases where citations are not available, are presented using language that indicates they existed prior to this work. iv Table of Contents Abstract i Acknowledgements iii Statement of Originality iv Table of Contents v List of Figures xi Chapter 1: Introduction 1 1.1 Computer Language Transformation . 1 1.2 Motivation . 2 1.2.1 Parsing . 2 1.2.2 A New Transformation Language . 4 1.3 Thesis Outline . 5 Chapter 2: Background 7 2.1 Introduction . 7 2.2 Anatomy of a Transformation System . 8 2.2.1 Tokenization . 9 2.2.2 Generalized Parsing . 10 2.2.3 Representing Trees . 11 v 2.2.4 Tree Traversal . 12 2.2.5 Tree Pattern Matching . 13 2.2.6 Tree Construction . 13 2.2.7 Unparsing . 13 2.3 Generalized Parsing . 14 2.3.1 Classification of Parsing Strategies . 15 2.3.2 Unger's Method . 20 2.3.3 CYK Method . 24 2.3.4 Earley Parsing . 26 2.3.5 Generalized Top-Down . 30 2.3.6 Backtracking LR . 36 2.3.7 Generalized LR . 37 2.3.8 Limitations on Grammars Imposed by the Algorithms . 41 2.3.9 Time Complexities . 43 2.3.10 Controlling the Parse of Ambiguous Grammars . 45 2.3.11 Error Recovery . 46 2.3.12 Summary . 47 2.4 Context-Dependent Parsing . 48 2.4.1 Global State . 49 2.4.2 Nondeterminism and the Global State . 49 2.4.3 Requirements . 51 2.5 Source Transformation Systems . 54 2.5.1 ASF+SDF . 54 2.5.2 ELAN . 55 2.5.3 Stratego Language . 56 2.5.4 TXL . 57 2.5.5 Integration with General-Purpose Languages . 58 vi 2.6 Summary . 60 Chapter 3: Generalized Parsing for Tree Transformation 62 3.1 Introduction . 62 3.2 Backtracking LR . 63 3.3 User-Controlled Parsing Strategy . 64 3.3.1 Ordering Example . 66 3.3.2 Out-of-Order Parse Correction . 67 3.3.3 Ordered Choice and Left Recursion . 70 3.3.4 Sequences . 72 3.3.5 Longest/Shortest Match . 73 3.4 Discarding Alternatives . 74 3.5 Error Recovery . 75 3.6 Grammar-Dependent Lexical Rules . 76 3.7 Summary . 78 Chapter 4: COLM: A Tree-Based Programming Language 80 4.1 Designing a New Transformation System . 81 4.1.1 Implementing a New System . 81 4.1.2 Designing a New Language . 82 4.2 Language Overview . 83 4.2.1 Value Semantics . 84 4.2.2 Root Language Elements . 84 4.2.3 Tokens . 85 4.3 General-Purpose Constructs . 85 4.3.1 Statements . 85 4.3.2 Expressions . 87 4.3.3 Functions . 87 vii 4.3.4 Global Variables . 89 4.3.5 Dynamic Variables . 90 4.4 Type Definitions . 91 4.4.1 Token Definitions . 92 4.4.2 Context-Free Language Definitions . 95 4.4.3 Extended Types . 96 4.5 Matching Patterns . 98 4.6 Synthesizing Trees . 101 4.7 Traversing and Manipulating Trees . 103 4.7.1 References . 104 4.7.2 Iterators . 105 4.7.3 User-Defined Iterators . 107 4.8 Generic Transformation Idioms . 107 4.8.1 Top-Down, Left-Right, One-Pass . 107 4.8.2 Fixed-Point Iteration . 109 4.8.3 Bottom-Up Traversals . 110 4.8.4 Right-Left Traversals . 110 4.9 Transformation Example: Goto Elimination . 110 4.10 Implementation Notes . 111 4.10.1 Tree Sharing . 112 4.10.2 The Tree-Kid Pair . 114 4.10.3 Reference Chains . 114 4.10.4 Implementation-Caused Language Restrictions . 116 4.10.5 The Virtual Machine . 118 4.11 Summary . 119 Chapter 5: Context-Dependent Parsing 120 viii 5.1 Token-Generation Actions . 121 5.2 Reduction Actions . 122 5.3 Semantic Predicates . ..
Recommended publications
  • The History of Computer Language Selection
    The History of Computer Language Selection Kevin R. Parker College of Business, Idaho State University, Pocatello, Idaho USA [email protected] Bill Davey School of Business Information Technology, RMIT University, Melbourne, Australia [email protected] Abstract: This examines the history of computer language choice for both industry use and university programming courses. The study considers events in two developed countries and reveals themes that may be common in the language selection history of other developed nations. History shows a set of recurring problems for those involved in choosing languages. This study shows that those involved in the selection process can be informed by history when making those decisions. Keywords: selection of programming languages, pragmatic approach to selection, pedagogical approach to selection. 1. Introduction The history of computing is often expressed in terms of significant hardware developments. Both the United States and Australia made early contributions in computing. Many trace the dawn of the history of programmable computers to Eckert and Mauchly’s departure from the ENIAC project to start the Eckert-Mauchly Computer Corporation. In Australia, the history of programmable computers starts with CSIRAC, the fourth programmable computer in the world that ran its first test program in 1949. This computer, manufactured by the government science organization (CSIRO), was used into the 1960s as a working machine at the University of Melbourne and still exists as a complete unit at the Museum of Victoria in Melbourne. Australia’s early entry into computing makes a comparison with the United States interesting. These early computers needed programmers, that is, people with the expertise to convert a problem into a mathematical representation directly executable by the computer.
    [Show full text]
  • Download CMPEN 270 Design Project 3 Part 1
    Watch the video before the lab! *If you do the lab incorrectly, no excuses are valid, and the video will explain all of the finer details of the lab needed to correctly complete the lab! *Labs will not always be graded before the due date. Do not rely on the ability to resubmit a lab before the due date. *Attend your specific lab section for the best chance to learn and perform well on the labs. NO Late Submissions allowed! *The labs are a very small percentage of the grade, and they are designed to help you learn. Come to class prepared, and with a good mindset, with intentions on learning. The labs are low risk because they are worth little to no points for your overall grade. *TWO labs/homeworks will be dropped at the end of the semester! CMPEN 270 Design Project 3 #1 2021 Resources for the Lab: 1. Tutorial: "http://www.asic-world.com/verilog/veritut.html" Hardware Description Language In computer engineering, a hardware description language (HDL) is a specialized computer language used to describe the structure and behavior of electronic circuits, and most commonly, digital logic circuits. A hardware description language enables a precise, formal description of an electronic circuit that allows for the automated analysis and simulation of an electronic circuit. It also allows for the synthesis of a HDL description into a netlist (a specification of physical electronic components and how they are connected), which can then be placed and routed to produce the set of masks used to create an integrated circuit.
    [Show full text]
  • Computer Architecture Simulation Using a Register Transfer Language
    COMPUTER ARCHITECTURE SIMULATION USING A REGISTER TRANSFER LANGUAGE, by LESTER BARTEL B. A., Tabor College, 1983 A MASTER'S THESIS submitted in partial fulfillment of the requirements for the degree MASTER OF SCIENCE Department of Computer Science KANSAS STATE UNIVERSITY Manhattan, Kansas 1986 Approved by: Majory 'rofessor A11ED5 b565Q3 .TH- Table of Contents List of Figures v Acknowledgements vi 1 . Introduction 1 1 .1 . Purpose of an Architecture Simulator 1 1 .2 . Instruction Set Processor 3 1 .3 . Machine Cycle Simulator 3 1 .4 . Register Transfer Language 4 1 .5 . Silicon Compilers 6 1 .6 . Definitions 8 2 . Review of Existing CHDLs 10 2 .1 . Representative CHDLs 10 2 .1 .1 . CDL 10 2 .1 .2 . ISP 11 2 .1 .3 . AHPL 11 2 .1 .4 . DDL 13 2 .1 .5 . ADLIB 14 2 .1 .6 . DTMS 15 2 .1 .7 . CONLAN 17 2 .2 . Levels of Hardware Description 17 2 .2 .1 . Circuit Level 18 2 .2 .2 . Logic Gate Level 18 2 .2 .3 . Register Transfer Level 19 2 .2 .3 .1 . Structure Level 19 2 .2 .3 .2 . Functional Level 19 .2 . 2 .3 .3 Behavior Level . .20 2 .2 .4 . Instruction Set Level 20 2 .2 .5 . Processor Memory Switch Level 21 2 .2 .6 . Algorithmic Level 21 2 .3 . Applications of CHDLs 21 2 .3 .1 . Descriptive Tool 22 2 .3 .2 . Simulation and Design Verification 23 2 .3 .3 . Design Automation and Hardware Synthesis 24 3 . Introduction to ASIM II 25 3 .1 . Purpose of ASIM II 25 3 .2 . Description of Components 27 4 .
    [Show full text]
  • International Journal for Scientific Research & Development
    IJSRD - International Journal for Scientific Research & Development| Vol. 7, Issue 10, 2019 | ISSN (online): 2321-0613 Comparative Study of Hardware Languages and Programming Languages Mrs. A. N. Dubey1 Mrs. P. R. Autade2 1,2JSPM RSCOE Polytechnic IInd shift Tathawade, Pune, Maharashtra, India Abstract— Comparison of programming languages is a common topic of discussion for engineers but comparison of hardware languages and programming languages is very rare or not found easily. In this paper we present a comparative study between hardware languages such as VHDL, Verilog and SystemC and programming languages such as C,C++ and Java languages; These languages are compared under the characteristics of syntax of code, evolution reliability, tools, readability, efficiency, familiarity and applications used in Industry for future carrier with terms differentiation of various languages. Keywords: Hardware languages, HDL, Programming languages, C, Code, VHDL, Verilog I. INTRODUCTION The complexioness of integrated circuits increases every year, so reduce complexities invent Hardware Description Lanauages in1984 by Phil Moorby and Prabhu Goel around 1984. Implementing algorithms using hardware languages like VHDL or Verilog. The first level programming language was Plankalkül, created by Konrad Zuse between 1942 and Fig. 1: History of Programming Languages 1945. The main and important comparison between HDL and Programming Language is that HDL describes the behavior B. History of Hardware Languages- of digital systems while Software Language provides a set of Sr.no. Year Languages Description instructions for the CPU to perform a particular task. Mostly designed for Programming languages are extremely interesting. Computer simulation, formal 1 1972 FHL scientists tend to invent new programming languages.
    [Show full text]
  • Full Form of Html in Computer
    Full Form Of Html In Computer Hitchy Patsy never powwow so regressively or mate any Flavian unusually. Which Henrie truants so trustily that Jeremiah cackle her Lenin? Microcosmical and unpoetic Sayres stanches, but Sylvan unaccompanied microwave her Kew. Programming can exile very simple or repair complex. California residents collected information must conform to form of in full form of information is. Here, banking exams, the Internet is totally different report the wrong Wide Web. Serial ATA hard drives. What is widely used for browsers how would have more. Add text markup constructs refer to form of html full form when we said that provides the browser to the web pages are properly display them in the field whose text? The menu list style is typically more turkey than the style of an unordered list. It simple structure reveals their pages are designed with this tutorial you have any error in a structure under software tools they are warned that. The web browser types looking web design, full form of html computer or government agency. Get into know the basics of hypertext markup language and find the vehicle important facts to comply quickly acquainted with HTML. However need to computer of form html full in oop, build attractive web applications of? All these idioms are why definition that to download ccc certificate? Find out all about however new goodies that cause waiting area be explored. Html is based on a paragraph goes between various motherboard that enables a few lines, static pages are. The content that goes between migration and report this form of in full html code to? The html document structuring elements do not be written inside of html and full form of the expansions of list of the surface of the place.
    [Show full text]
  • A Literate Programming Approach for Hardware Description Language In- Struction
    Paper ID #26263 A Literate Programming Approach for Hardware Description Language In- struction Dr. J.W. Bruce, Tennessee Technological University J.W. Bruce is with the Department of Electrical & Computer Engineering at Tennessee Technological University in Cookeville, Tennessee USA Dr. Bryan A. Jones, Mississippi State University Bryan A. Jones received the B.S.E.E. and M.S. degrees in electrical engineering from Rice University, Houston, TX, in 1995 and 2002, respectively, and the Ph.D. degree in electrical engineering from Clemson University, Clemson, SC, in 2005. He is currently an Associate Professor at Mississippi State University, Mississippi State, MS. From 1996 to 2000, he was a Hardware Design Engineer with Compaq, where he specialized in board lay- out for high-availability redundant array of independent disks (RAID) controllers. His research interests include engineering education, robotics, and literate programming. Dr. Mahnas Jean Mohammadi-Aragh, Mississippi State University Dr. Jean Mohammadi-Aragh is an assistant professor in the Department of Electrical and Computer Engi- neering at Mississippi State University. Dr. Mohammadi-Aragh investigates the use of digital systems to measure and support engineering education, specifically through learning analytics and the pedagogical uses of digital systems. She also investigates fundamental questions critical to improving undergraduate engineering degree pathways. She earned her Ph.D. in Engineering Education from Virginia Tech. In 2013, Dr. Mohammadi-Aragh was honored as a promising new engineering education researcher when she was selected as an ASEE Educational Research and Methods Division Apprentice Faculty. c American Society for Engineering Education, 2019 A Literate Programming Approach for Hardware Description Language Instruction INTRODUCTION Digital devices are ubiquitous in modern life.
    [Show full text]
  • GRIFON - a Graphical Interface to an Object Oriented Database
    GRIFON - A Graphical Interface to an Object Oriented Database. A Thesis by: Padraig Moran B.Sc. Supervisors: Mr. Renaat Verbruggen, Mr. Michael Ryan. Submitted to the School of Computer Applications Dublin City University for the degree of Master of Science August 1991 DECLARATION : No portion of this work has been submitted in support of an application for another degree or qualification in Dublin City University or any other University or Institute of Learning. Acknowledgements I would like to thank IBM Ireland Information Services Ltd. (IISL), for their generous scholarship, help and support which made it possible for me to pursue this research. I would like to express my gratitude to the staff at DSL, especially Mr. John Dermody for his guidance and interest, and Mr. John Murphy for his invaluable advice and support. I would like to sincerely thank my supervisors, Renaat Verbruggen and Michael Ryan for their interest, support, patience, advice and encouragement. Thanks are also due to Dr. Alan Smeaton for materialising relevant research papers, seemingly out of the blue. I would like to express my thanks to Rev. T. Moran for the use of his computer, which substantially helped the writing of this thesis. Special appreciation is due to all in number 9, and especially Joanne, without whose support and sustenance this thesis would never have materialised. Finally I would like to acknowledge the support of my family, colleagues, and friends. To Mam, Dad and Nan who between them gave me the encouragement to pursue my studies and the invaluable chance to do so. Abstract The aim of the research outlined in this thesis is to establish what type of interface would be most suitable for object oriented databases.
    [Show full text]
  • Lecture 27: Verilog HDL Contd…
    4/1/2019 Indian Institute of Technology Jodhpur, Year 2018‐2019 Digital Logic and Design (Course Code: EE222) Lecture 27: Verilog HDL contd… Course Instructor: Shree Prakash Tiwari Email: [email protected] Webpage: http: //home.iitj.ac.in/ ~sptiwari/ Course related documents will be uploaded on http://home.iitj.ac.in/~sptiwari/DLD/ Note: The information provided in the slides are taken form text books Digital Electronics (including Mano & Ciletti), and various other resources from internet, for teaching/academic use only 1 Overview ° History of Verilog® HDL ° Overview of Digital Design with Verilog® HDL ° Hello World! ° Hierarchical Modeling Concepts Verilog HDL 2 1 4/1/2019 What is Verilog HDL? ° Verilog Hardware Description Language(HDL)? • A high-level computer language can model, represent and simulate digital design - Hardware concurrency - Parallel Activity Flow - Semantics for Signal Value and Time • Design examples using Verilog HDL - Intel Pentium, AMD K5, K6, Atheon, ARM7, etc - Thousands of ASIC designs using Verilog HDL 3 What is VHDL? ° VHDL represents another high level language for digital system design. ° In this course we study Verilog HDL • reason: - used more often in electronic and computer industry - programming style is very similar to C programming language 4 2 4/1/2019 History of Verilog® HDL ° Beginning: 1983 • “Gateway Design Automation” company • Simulation environment - CiiillfbttiComprising various levels of abstraction – Switch (transistors), gate, register-transfer, and higher levels Verilog HDL 5 History
    [Show full text]
  • Site Development Associate Student Guide Web Foundations Series CCL02-CFSDFN-PR-1405 • Version 2.1 • Rd060214
    Site Development Associate Student Guide Web Foundations Series CCL02-CFSDFN-PR-1405 • version 2.1 • rd060214 EVALUATION COPY EVALUATION COPY Site Development Associate Student Guide EVALUATION COPY Chief Executive Officer Barry Fingerhut Vice President, Operations & Development Todd Hopkins Senior Content Developer Kenneth A. Kozakis Managing Editor Susan M. Lane Editor Sarah Skodak Project Manager/Publisher Tina Strong Customer Service Certification Partners, LLC 1230 W. Washington St., Ste. 201 Tempe, AZ 85281 (602) 275-7700 Copyright © 2014, All rights reserved. EVALUATION COPY Site Development Associate Developer Patrick T. Lane Contributors DeAnne Bowersock, James Stanger, Ph.D., and Kenneth A. Kozakis Editor Sarah Skodak Project Manager/Publisher Tina Strong Trademarks Certification Partners is a trademark of Certification Partners, LLC. All product names and services identified throughout this book are trademarks or registered trademarks of their respective companies. They are used throughout this book in editorial fashion only. No such use, or the use of any trade name, is intended to convey endorsement or other affiliation with the book. Copyrights of any screen captures in this book are the property of the software's manufacturer. Disclaimer Certification Partners, LLC, makes a genuine attempt to ensure the accuracy and quality of the content described herein; however, Certification Partners makes no warranty, express or implied, with respect to the quality, reliability, accuracy, or freedom from error of this document or the products it describes. Certification Partners makes no representation or warranty with respect to the contents hereof and specifically disclaims any implied warranties of fitness for any particular purpose. Certification Partners disclaims all liability for any direct, indirect, incidental or consequential, special or exemplary damages resulting from the use of the information in this document or from the use of any products described in this document.
    [Show full text]
  • The A-Z of Programming Languages (Interviews with Programming Language Creators)
    The A-Z of Programming Languages (interviews with programming language creators) Computerworld, 2008-20101 Ada: S. Tucker Taft ...................................................... 1 Arduino: Tom Igoe ...................................................... 5 ASP: Microsoft .......................................................... 9 AWK: Alfred Aho ....................................................... 11 AWK & AMPL: Brian Kernighan ....................................... 15 Bash: Chet Ramey....................................................... 17 C#: Anders Hejlsberg.................................................... 20 C++: Bjarne Stroustrup ................................................. 27 Clojure: Rich Hickey .................................................... 35 ColdFusion: Jeremy Allaire .............................................. 38 D: Walter Bright ......................................................... 41 Erlang: Joe Armstrong................................................... 44 F#: Don Syme .......................................................... 48 Falcon: Giancarlo Niccolai ............................................... 51 Forth: Charles Moore .................................................... 59 Groovy: Guillaume Laforge .............................................. 61 Haskell: Simon Peyton-Jones............................................. 65 INTERCAL: Don Wood................................................. 76 JavaScript: Brendan Eich................................................ 79 Lua: Roberto Ierusalimschy..............................................
    [Show full text]
  • COS 301 Programming Languages
    COS 301 Topics Programming Languages • Reasons for Studying Concepts of Programming Languages • Programming Domains Preliminaries • Language Evaluation Criteria • Influences on Language Design • Language Categories • Language Design Trade-Offs • Implementation Methods • Programming Environments Why Study Concepts of Programming Why Study Concepts of Programming Languages? Languages? • Increased ability to express ideas • To improve expressiveness • Improved background for choosing appropriate – Expressiveness increases with vocabulary languages – Ability to visualize solutions increases with new programming constructs and depth of abstraction • Increased ability to learn new languages – If the only tool you know is a hammer, the only • Better understanding of significance of solutions you can see involve nails implementation – Even if a language does not directly support a • Better use of languages that are already particular abstract feature (e.g. associative array) known you can simulate it as part of solution • Overall advancement of computing Gain improved background for choosing Improve your ability to learn new appropriate languages languages • A fundamental result of theory is that all • First language or two are difficult and time- languages are equivalent in computing power consuming to learn • Anything that can be computed in Java or • These languages also constrict your view of Python can also be computed in BASIC, COBOL or languages – As you learn the abstract concepts underlying FORTRAN programming languages you acquire a framework for – But some languages are better in terms of understanding a new language expressiveness for a given problem – Eventually you can read many unfamiliar languages – Learning just one or two languages in great depth can with little or minimal effort be hazardous to your career – Current trend is to combine relatively simple language with a huge library.
    [Show full text]
  • Annotation Based Parser Generator*
    UDC 004.4, DOI: 10.2298/CSIS1002291P Annotation Based Parser Generator* Jaroslav Porubän1, Michal Forgáþ1, Miroslav Sabo1, and Marek BČhálek2 1 Department of Computers and Informatics, Technical University of Košice, Letná 9, 042 00 Košice, Slovak Republic {Jaroslav.Poruban, Michal.Forgac, Miroslav.Sabo}@tuke.sk 2 Department of Computer Science, FEI VŠB Technical University of Ostrava, 17. listopadu 15, 708 33 Ostrava-Poruba, Czech Republic [email protected] Abstract. The paper presents innovative parser construction method and parser generator prototype which generates a computer language parser directly from a set of annotated classes in contrast to standard parser generators which specify concrete syntax of a computer language using BNF notation. A language with textual concrete syntax is defined upon the abstract syntax definition extended with annotations in the presented approach. Annotations define instances of concrete syntax patterns in a language. Abstract syntax of a language is inevitable input of the parser generator as well as language’s concrete syntax pattern definitions. The process of parser implementation is presented on the concrete computer language – the Simple Arithmetic Language. The paper summarizes results of the studies of implemented parser generator and describes its role in the university courses. Keywords: parser generator; annotated model; abstract syntax; model to grammar transformation. 1. Introduction Computer languages are crucial tools in the development of software systems. By using computer languages we define the structure of a system and its behavior. Today's common industry practice is to create a software system as a composition of software artifacts written in more than one computer language. Developers use different languages and paradigms throughout the development of a software system according to a nature of concrete subproblem and their preferences.
    [Show full text]