Generátor kompilátorů založený na restartovacích automatech
Compiler generator based on restarting automata
diploma thesis (DEFENDED)
![Document thumbnail](/bitstream/handle/20.500.11956/22735/thumbnail.png?sequence=7&isAllowed=y)
View/ Open
Permanent link
http://hdl.handle.net/20.500.11956/22735Identifiers
Study Information System: 65590
Collections
- Kvalifikační práce [11266]
Author
Advisor
Referee
Plátek, Martin
Faculty / Institute
Faculty of Mathematics and Physics
Discipline
Theoretical Computer Science
Department
Department of Software and Computer Science Education
Date of defense
31. 5. 2010
Publisher
Univerzita Karlova, Matematicko-fyzikální fakultaLanguage
Czech
Grade
Excellent
Restartovací automaty jsou velmi silný teoretický model, který umožňuje (ve své nejobecnější variantě) rozpoznávat mnohem širší třídu jazyků, než je třída jazyků bezkontextových. Cílem této práce bylo vytvořit nástroj, který pro daný restartovací automat zapsaný pro člověka čitelnou formou generuje program počítající význam vstupního textu. Bylo proto nutné model rozšířit o sémantiku. Výsledný nástroj je generátor kompilátorů (CCRA) a vychází z nástrojů jako je flex, či bison, ale místo bezkontextové gramatiky používá restartovací automat. Je napsaný v jazyce C++ tak, aby bylo možné ho používat jak na systémech Windows, tak Linux. Stejný jazyk používá pro svůj výstup.
Restarting automata, in their most general form, represent a very strong theoretical model recognizing much wider class of languages than the class of context-free ones. Hence, our goal was to design a tool which for a given restarting automaton (in human-readable format) generates a program computing the meaning of an input text. In order to enable that, this thesis extends the model of restarting automata by adding semantics to its meta-instruction. The resulting program is a compiler-compiler (CCRA) inspired by the tools such as flex or bison. However, the CCRA uses restarting automaton instead of a context-free grammar. The implementation as well as the output are realized in C++ which ensures the compatibility with both Windows and Linux systems.