Design of efficient Programming Language with Lexer using ’$’-prefixed identifier
DOI:
https://doi.org/10.4108/eetsis.3920Keywords:
Lexer, Tokenization, Time complexity, Iterations, Data structure, Syntax, '$'-prefixed identifiers, CompilationAbstract
An identifier which starts with ‘$‘is known as ‘$‘-prefixed identifier and this type of identifiers are used in our research paper to improve the lexical analysis phase. This paper talks about a new programming language with ‘$‘-prefixed identifier that features a novel approach for optimizing the lexer for efficient lexical analysis which can be applied to any existing language. This approach is used to classify identifiers and keywords using ‘$‘-prefixed variables, which significantly reduces the time taken and number of iterations required during the tokenization process, leading to improved overall performance. This type of language structure allows for fast lookup and matching of tokens. We conducted a series of experiments to evaluate the performance of our lexer and compared it with a regular lexer. Our results show that our approach leads to significant improvements in time complexity and number of iterations for identifying whether the token is an identifier or a keyword, resulting in faster compilation times and improved overall performance. Our language has reduced the amount of time taken by 7-10% and 45-50% in terms of iterations. Our language and lexer represent a significant step forward in the design and implementation of high-performance programming languages by reducing the number of iterations and time taken to identify whether a token is a keyword or an identifier.
References
Appel, A. W. (2004). Modern compiler implementation in C. Cambridge university press.
Aho, A. V., Sethi, R., & Ullman, J. D. (2007). Compilers: principles, techniques, and tools (Vol. 2). Reading: Addison-wesley.
Sanju, V. (2016, March). An exploration on lexical analysis. In 2016 International Conference on Electrical, Electronics, and Optimization Techniques (ICEEOT) (pp. 253-258). IEEE. DOI: 10.1109/ICEEOT.2016.7755127
Chhabra, J., Chopra, H., & Vats, A. (2014). Research paper on Compiler Design. International Journal of Innovative Research in Technology, 1(5), 151-153.
Haili Luo The Research of Applying Regular Grammar to Making Model for Lexical Analyzer, Proceedings of IEEE 6th International Conference on Information Management, Innovation Management & Industrial Engi-neering, pp 90-92 , 2013. DOI: 10.1109/ICIII.2013.6703245
Sanju, V. (2016, March). An exploration on lexical analysis. In 2016 International Conference on Electrical, Electronics, and Optimization Techniques (ICEEOT) (pp. 253-258). IEEE. DOI: 10.1109/ICEEOT.2016.7755127
Wu, X., Mernik, M., Bryant, B. R., & Gray, J. (2009). Implementation of Programming Languages Syntax and Semantics. In Encyclopedia of Information Science and Technology, Second Edition (pp. 1863-1869). IGI Global DOI: 10.4018/978-1-60566-026-4.ch293
Aho, A. V., & Ullman, J. D. (1973). The theory of parsing, translation, and compiling (Vol. 1, p. 309). Englewood Cliffs, NJ: Prentice-Hall.
Abubakar, B. S., Ahmad, A., Aliyu, M. M., Ahmad, M. M., & Uba, H. U. (2021). An Overview of Compiler Construction. Int. Res. J. Eng. Technol., 8(3), 578-590.
Chen, H., Ching, W. M., & Hendren, L. (2017, June). An ELI-to-C compiler: design, implementation, and performance. In Proceedings of the 4th ACM SIGPLAN International Workshop on Libraries, Languages, and Compilers for Array Programming (pp. 9-16). https://doi.org/10.1145/3091966.3091969
Pai T, V., & Aithal, P. S. (2020). A Systematic Literature Review of Lexical Analyzer Implementation Techniques in Compiler Design. International Journal of Applied Engineering and Management Letters (IJAEML), 4(2), 285 301.
Bhosale, V., & Chaudhari, S. R. (2015). Fuzzy Lexical Analyser: Design and Implementation. International Journal of Computer Applications, 123(11). DOI:10.5120/ijca2015905567
Marowka, A. (2004, July). Analytic comparison of two advanced c language-based parallel programming models. In Third International Symposium on Parallel and Distributed Computing/Third International Workshop on Algorithms, Models and Tools for Parallel Computing on
Heterogeneous Networks (pp. 284-291). IEEE. DOI:10.1109/ISPDC.2004.11
Omori, Y., Joe, K., & Fukuda, A. (1997, August). A parallelizing compiler by object-oriented design. In Proceedings Twenty-First Annual International Computer Software and Applications Conference (COMP- SAC’97) (pp. 232-239). IEEE. Doi:10.1109/CMPSAC.1997.624802
Barve, A., & Joshi, B. K. (2016). Fast parallel lexical analysis on multi- core machines. International Journal of High-Performance Computing and Networking, 9(3), 250-257. https://doi.org/10.1504/ijhpcn.2016.076270
Barve, A., & Joshi, B. K. (2015). Improved Parallel Lexical Analysis using OpenMP on Multi-core Machines. Procedia Computer Science, 49, 211-219. https://doi.org/10.1016/j.procs.2015.04.246
Jena, S. K., Das, S., & Sahoo, S. P. (2018). Design and Development of a Parallel Lexical Analyzer for C Language. International Journal of Knowledge-Based Organizations (IJKBO), 8(1), 68-82. https://doi.org/10.4018/IJKBO.2018010105
Barve, A., & Joshi, B. K. (2012, December). Parallel lexical analysis on multi-core machines using divide and conquer. In 2012 Nirma University International Conference on Engineering (NUiCONE) (pp. 1-5). IEEE. DOI: 10.1109/NUICONE.2012.6493218
Srikanth, G. U. (2010, June). Parallel lexical analyzer on the cell processor. In 2010 Fourth International Conference on Secure Software Integration and Reliability Improvement Companion (pp. 28-29). IEEE. https://doi.org/10.1109/SSIRI-C.2010.16
Barve, A., Khomane, S., Kulkarni, B., Ghadage, S., & Katare, S. (2017, December). Parallelism in C++ programs targeting objects. In 2017 International Conference on Advances in Computing, Communication and Control (ICAC3) (pp. 1-6). IEEE. DOI:
1109/ICAC3.2017.8318759
Marowka, A. (2008, December). Towards high-level parallel programming models for multicore systems. In 2008 Advanced Software Engineering and Its Applications (pp. 226-229). IEEE. https://doi.org/10.1109/ASEA.2008.9
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2023 Priya Gupta, L S Yaswanth Kumar, J V V M S D Santosh, D Yashwanth Kumar, Chokkari Dinesh, Mukkoti Maruthi Venkata Chalapathi
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
This is an open access article distributed under the terms of the CC BY-NC-SA 4.0, which permits copying, redistributing, remixing, transformation, and building upon the material in any medium so long as the original work is properly cited.