Preview

Proceedings of the Institute for System Programming of the RAS (Proceedings of ISP RAS)

Advanced search

Library for Development of Compilers

https://doi.org/10.15514/ISPRAS-2022-34(5)-5

Abstract

This work is devoted to the development of a library designed to implement compilers. The article contains a description of the library's features and the main points of its functioning. In the course of the work, the generation of parsers using LR(1)-automata was studied and implemented, two auxiliary languages were designed and implemented: a semantic network query language and a language designed to generate executable code. The result of the work is a library for the platform .NET (the library was tested for the C# language), which contains classes that make easier the implementation of source code parsing, semantic analysis, and executable file generation. This library does not have external dependencies, except for the standard .NET library.

About the Authors

Sergei Vladimirovich MIRONOV
Saratov State University
Russian Federation

Candidate of Science in Physics and Mathematics, Associate Professor, Dean of the Faculty of Computer Science and Information Technologies



Inna Aleksandrovna BATRAEVA
Saratov State University
Russian Federation

Candidate of Science in Physics and Mathematics, Associate Professor, Head of the Department of Programming Technologies



Pavel Dmitrievich DUNAEV
Saratov State University
Russian Federation

Master's Student 



References

1. Lewis P., Stearns R. Syntax-Directed Transduction. Journal of the ACM, vol. 15, issue 3, 1968, pp. 465-488.

2. Knuth D. On the Translation Languages from Left to Right. Information and Control, vol. 8, issue 6, 1965, pp. 607-639.

3. DeRemer F. Practical Translators for LR(k) Languages. PhD Thesis, Massachusetts Institute of Technology, 1969, 215 p.

4. Lang B. Deterministic Techniques for Efficient Non-Deterministic Parsers. Lecture Notes in Computer Science, vol. 14, 1974, pp. 255-269.

5. Goloveshkin A.V. Tolerant parsing using modified LR(1) and LL(1) algorithms with embedded “Any” symbol. Trudy ISP RAN/Proc. ISP RAS, vol. 31, issue 3, 2019, pp. 7-28. DOI: 10.15514/ISPRAS-2019-31(3)-1.

6. Савицкий В.О., Сидоров Д.В. «Ленивый» анализ исходного кода на языках С и С++. Труды ИСП РАН, том 23, 2012 г., стр. 133-142 / Savitsky V.O., Sidorov D.V. Lazy source code analysis for C/C++ languages. Trudy ISP RAN/Proc. ISP RAS, vol. 23, 2012, pp. 133-142 (in Russian). DOI: 10.15514/ISPRAS-2012-23-8.

7. GNU Bison. Available at: https://www.gnu.org/software/bison/.

8. ANTLR. Available at: https://www.antlr.org/.

9. Coco/R. Available at: https://ssw.jku.at/Research/Projects/Coco/.

10. Белеванцев А.А., Велесевич Е.А. Анализ сущностей программ на языках Си/Си++ и связей между ними для понимания программ. Труды ИСП РАН, том 27, вып. 2, 2015 г., стр. 53-64. / A. Belevantsev, E. Velesevich. Analyzing C/C++ Code Entities and Relations for Program Understanding Trudy ISP RAN /Proc. ISP RAS, vol. 27, issue 2, 2015, pp. 53-64 (in Russian). DOI: 10.15514/ISPRAS-2015-27(2)-4.

11. The LLVM Compiler Infrastructure. Available at: https://llvm.org/.

12. Microsoft Docs: System.Reflection.Emit Namespace. Available at: https://learn.microsoft.com/en-us/dotnet/api/system.reflection.emit?view=netstandard-2.0.

13. The Open Group Base Specifications Issue 7, 2018 edition, IEEE Std 1003.1™-2017 (Revision of IEEE Std 1003.1-2008). Chapter 9. Regular Expressions. Available at: https://pubs.opengroup.org/onlinepubs/9699919799.

14. Ахо А., Ульман Дж. Теория синтаксического анализа, перевода и компиляции. Том 1: Синтаксический анализ. М., Издательство МИР, 1978, 616 стр. / Aho A., Ullman J. The Theory of Parsing, Translation and Compiling. Volume 1: Parsing. Prentice Hall, 1972, 542 p.

15. Ахо А., Лам М. и др. Компиляторы. Принципы, технологии и инструментарий. М., Издательский дом Вильямс, 2008, 1178 стр. / Aho A., Lam M. et al. Principles, Techniques, & Tools. M., Addison Wesley, 2006, 1040 p.

16. Microsoft Docs: HeapAlloc function (heapapi.h). Available at: https://learn.microsoft.com/en-us/windows/win32/api/heapapi/nf-heapapi-heapalloc.

17. AMD64 Architecture Programmer’s Manual: Volumes 1-5. Available at: https://www.amd.com/system/files/TechDocs/40332_4.05.pdf.

18. Microsoft Portable Executable and Common Object File Format Specification. Revision 11 – June 20, 2017. Available at: https://download.microsoft.com/download/9/c/5/9c5b2167-8017-4bae-9fde-d599bac8184a/pecoff.docx.


Review

For citations:


MIRONOV S.V., BATRAEVA I.A., DUNAEV P.D. Library for Development of Compilers. Proceedings of the Institute for System Programming of the RAS (Proceedings of ISP RAS). 2022;34(5):77-88. (In Russ.) https://doi.org/10.15514/ISPRAS-2022-34(5)-5



Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 License.


ISSN 2079-8156 (Print)
ISSN 2220-6426 (Online)