API for C# code generation
Rozhraní pro generování C# kódu
bakalářská práce (OBHÁJENO)
Zobrazit/ otevřít
Trvalý odkaz
http://hdl.handle.net/20.500.11956/120973Identifikátory
SIS: 223158
Kolekce
- Kvalifikační práce [10932]
Autor
Vedoucí práce
Oponent práce
Kliber, Filip
Fakulta / součást
Matematicko-fyzikální fakulta
Obor
Programování a softwarové systémy
Katedra / ústav / klinika
Katedra aplikované matematiky
Datum obhajoby
14. 9. 2020
Nakladatel
Univerzita Karlova, Matematicko-fyzikální fakultaJazyk
Angličtina
Známka
Výborně
Klíčová slova (česky)
generování kódu, C#, ILSpy, CoberecKlíčová slova (anglicky)
code generation, C#, ILSpy, CoberecV práci představujeme knihovnu pro implementaci robustních generátorů kódu v jazyce C#. Stávající generátory kódu často pro nějaké vstupy produkují nepřeložitelný kód. Dochází ke jmeným kolizím a dalším problémům, což zhoršuje stabilitu generování kódu. Tyto případy pak rozbíjí zavedené procesy sestavování aplikací a programátoři je musí řešit ručně. Naše knihovna tyto problémy řeší. Automaticky se vyhýbá jmeným kolizím a dalším nejednoznačnostem, zatímco produkuje čitelný kód. Náš přístup porovnáme s jinými řešeními, mimo jiné s metaprogramováním založeném na reflexi, makrech a automatickým přepisováním mezijazyka. 1
This work presents a library for implementing robust generators of C# code. Exist- ing code generators often generate invalid code for some inputs. Issues such as name collisions reduce the reliability of code generation. Programmers are then forced to han- dle these cases manually, which breaks build pipelines and lowers productivity. Our library solves these issues. It automatically avoids name collisions, and keeps the gener- ated code clean and human-readable. We compare our approach to other solutions such as reflection-based metaprogramming, macros, intermediate language rewriting and F# Type Providers. 1