Parsing and semantic analysis of a domain specific language

A domain specific language (DSL) is a computer programming language of limited expressiveness focused on a particular domain. A DSL offers programmers a high level abstraction for them to express their algorithms. In engineering and the sciences, MATLAB is a commonly used domain specific language to...

Full description

Saved in:
Bibliographic Details
Main Author: Qin, Gemeng
Other Authors: Stephen John Turner
Format: Final Year Project
Language:English
Published: 2014
Subjects:
Online Access:http://hdl.handle.net/10356/59990
Tags: Add Tag
No Tags, Be the first to tag this record!
Institution: Nanyang Technological University
Language: English
id sg-ntu-dr.10356-59990
record_format dspace
spelling sg-ntu-dr.10356-599902023-03-03T20:58:10Z Parsing and semantic analysis of a domain specific language Qin, Gemeng Stephen John Turner School of Computer Engineering Parallel and Distributed Computing Centre DRNTU::Engineering::Computer science and engineering A domain specific language (DSL) is a computer programming language of limited expressiveness focused on a particular domain. A DSL offers programmers a high level abstraction for them to express their algorithms. In engineering and the sciences, MATLAB is a commonly used domain specific language to quickly prototype algorithms owing to the dynamic nature of the language and its ease of use. However, the dynamic nature of the language comes with additional costs, such as overheads due to late binding. The front-end for MATLAB was developed in this project to translate MATLAB to the intermediate language so that MATLAB can be translated into a static programming language such as C/C++ to reduce the overheads and other costs of the dynamic feature. In this project, stencil computation in MATLAB is analysed as a case study. Since all data types in MATLAB is in a form of an array, the analysis of arrays were performed in the implementation. This report presents how a parser was implemented to parse the MATLAB language and how the constructs are represented internally using an intermediate representation. Certain semantic analysis were also performed to ensure that the user-written codes are well-formed as well as to infer type information from the source code. This involves processes such as type inference of variables in MATLAB, size inference of array and error checking of uninitialized variables, and array type or shape mismatch. Bachelor of Engineering (Computer Science) 2014-05-21T07:49:49Z 2014-05-21T07:49:49Z 2014 2014 Final Year Project (FYP) http://hdl.handle.net/10356/59990 en Nanyang Technological University 47 p. application/pdf
institution Nanyang Technological University
building NTU Library
continent Asia
country Singapore
Singapore
content_provider NTU Library
collection DR-NTU
language English
topic DRNTU::Engineering::Computer science and engineering
spellingShingle DRNTU::Engineering::Computer science and engineering
Qin, Gemeng
Parsing and semantic analysis of a domain specific language
description A domain specific language (DSL) is a computer programming language of limited expressiveness focused on a particular domain. A DSL offers programmers a high level abstraction for them to express their algorithms. In engineering and the sciences, MATLAB is a commonly used domain specific language to quickly prototype algorithms owing to the dynamic nature of the language and its ease of use. However, the dynamic nature of the language comes with additional costs, such as overheads due to late binding. The front-end for MATLAB was developed in this project to translate MATLAB to the intermediate language so that MATLAB can be translated into a static programming language such as C/C++ to reduce the overheads and other costs of the dynamic feature. In this project, stencil computation in MATLAB is analysed as a case study. Since all data types in MATLAB is in a form of an array, the analysis of arrays were performed in the implementation. This report presents how a parser was implemented to parse the MATLAB language and how the constructs are represented internally using an intermediate representation. Certain semantic analysis were also performed to ensure that the user-written codes are well-formed as well as to infer type information from the source code. This involves processes such as type inference of variables in MATLAB, size inference of array and error checking of uninitialized variables, and array type or shape mismatch.
author2 Stephen John Turner
author_facet Stephen John Turner
Qin, Gemeng
format Final Year Project
author Qin, Gemeng
author_sort Qin, Gemeng
title Parsing and semantic analysis of a domain specific language
title_short Parsing and semantic analysis of a domain specific language
title_full Parsing and semantic analysis of a domain specific language
title_fullStr Parsing and semantic analysis of a domain specific language
title_full_unstemmed Parsing and semantic analysis of a domain specific language
title_sort parsing and semantic analysis of a domain specific language
publishDate 2014
url http://hdl.handle.net/10356/59990
_version_ 1759857651398737920