is Íslenska en English

Lokaverkefni (Bakkalár)

Háskóli Íslands > Verkfræði- og náttúruvísindasvið > B.S. verkefni - Verkfræði- og náttúruvísindasvið >

Vinsamlegast notið þetta auðkenni þegar þið vitnið til verksins eða tengið í það: https://hdl.handle.net/1946/15772

Titill: 
  • Þáttunartöflusmiður fyrir kennslu
  • Titill er á ensku Parsing Table Generator for Compiler Theory
Námsstig: 
  • Bakkalár
Leiðbeinandi: 
Útdráttur: 
  • Útdráttur er á ensku

    The goal of this project was to create an open source teaching tool along with a User Manual. The result is the command-line program PTG which generates files contains either a parsing table or a state machine for the given grammar. It can generate more than one file each time it is run.
    Generating these tables and machines is a common and well defined problem when studying compilers. Furthermore deterministic processes for solving these problems are known and well documented. Sadly these processes have two faults, they are both time consuming and prone to errors when carried out by a human.
    Both faults can be circumvented by using a program that fulfills these tasks. PTG saves the user time by having a low execution time and minimalistic input grammar file format. PTG avoids errors by implementing well known processes to generate the tables and state machines.
    Why use PTG?
    - Analyzing a grammar is time consuming. Analyzing a modified grammar is nearly as time consuming. PTG allows the user to do this quickly and without errors to see the subtle changes a slight modification can bring to a grammar.
    - Analyzing a grammar by hand is painstaking and usually incomprehensible the first few times. PTG allows a user to verify his solution in a simple manner.
    - After analyzing a grammar the next step is often to digitalize the solution to use in a document. The output of PTG is already in a digital format ready for insertion.
    PTG fulfills the stated goals of the project by generating files containing a FIRST, FOLLOW, LL(1), SLR(1), LALR(1) or LR(1) parsing tables in either TeX and HTML format. Furthermore files containing a LR(0), LALR(0) or LR(1) state machine can be generated in either GraphViz Dot or TiKz format; although only the latter can be used unmodified in TeX files. The downside of PTG is that it requires more testing. The input grammar files and command line options intentionally have very few restrictions but this means that finding input that causes unexpected results should be relativily easy. The program, User Manual and source code is open for everyone at the PTG repository ( https://github.com/EgillEinarss/PTG ), and the body of this thesis is just a retailoring of the User Manual.

Samþykkt: 
  • 14.6.2013
URI: 
  • http://hdl.handle.net/1946/15772


Skrár
Skráarnafn Stærð AðgangurLýsingSkráartegund 
EBE_BSc_project.pdf434,74 kBOpinnHeildartextiPDFSkoða/Opna