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...

Ամբողջական նկարագրություն

Մատենագիտական մանրամասներ
Հիմնական հեղինակ: Qin, Gemeng
Այլ հեղինակներ: Stephen John Turner
Ձևաչափ: Final Year Project (FYP)
Լեզու:English
Հրապարակվել է: 2014
Խորագրեր:
Առցանց հասանելիություն:http://hdl.handle.net/10356/59990
_version_ 1826130696521908224
author Qin, Gemeng
author2 Stephen John Turner
author_facet Stephen John Turner
Qin, Gemeng
author_sort Qin, Gemeng
collection NTU
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.
first_indexed 2024-10-01T08:00:10Z
format Final Year Project (FYP)
id ntu-10356/59990
institution Nanyang Technological University
language English
last_indexed 2024-10-01T08:00:10Z
publishDate 2014
record_format dspace
spelling ntu-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
spellingShingle DRNTU::Engineering::Computer science and engineering
Qin, Gemeng
Parsing and semantic analysis of a domain specific language
title 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_short Parsing and semantic analysis of a domain specific language
title_sort parsing and semantic analysis of a domain specific language
topic DRNTU::Engineering::Computer science and engineering
url http://hdl.handle.net/10356/59990
work_keys_str_mv AT qingemeng parsingandsemanticanalysisofadomainspecificlanguage