- Notifications
You must be signed in to change notification settings - Fork0
Compiler of a subset of Zig (IFJ24)
License
fifixsandy/NGLYD-IFJ24-Compiler
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
In this repository you can find implementation of a compiler for a subset of Zig programming language - IFJ24.It has been developed by team NGLYD as a semestral project forIFJ (Formal languages and compilers) course on Brno University of Technology, Faculty of information technologies.
Compiler consists of following parts:
- lexical analyser based onfinite automaton
- LL1 recursive top-down syntactic analyser
- syntactic analyser of expressions based onprecedence table
- generator ofabstract syntactic tree
- symbol table implemented asAVS-tree
- generator of intermediate code "IFJcode24"
Lexical, syntactic and semantic checks are perfomed during tokenizing and parsing.For more detailed description, refer to documentation.pdf in /doc.
Linux
Target | Description | Command Example |
---|---|---|
dev | Compiles source files into objects and links them. | make dev |
test | Runs the test script using the compiled binary and interpreter. | make test |
pack | Creates a zip package of source code and documentation. | make pack |
doc | Compiles the LaTeX documentation into a PDF. | make doc |
run | Runs the compiled executable with input/output redirection. | make run |
Make sure you have downloaded an interpreter forIFJcode24 fromthis link and have it in root directory.Usemake run
with input filein.ifj or execute the compiler with source file in IFJ24 with redirection to standard input.Compiler printsIFJcode24 to standard output. Redirect it to the interpreter or another file.
Module | Score | Passed/Total | Incorrect Return Codes | Incorrect Outputs |
---|---|---|---|---|
Lexical Analysis (error detection) | 91 % | 192/210 | 8 % | - |
Syntax Analysis (error detection) | 97 % | 261/267 | 2 % | - |
Semantic Analysis (error detection) | 98 % | 394/402 | 1 % | - |
Code Interpretation (basic) | 96 % | 346/360 | 2 % | 1 % |
Code Interpretation (expressions, built-ins) | 100 % | 170/170 | 0 % | 0 % |
Code Interpretation (complex) | 86 % | 363/421 | 13 % | 0 % |
Function Expressions (FUNEXP) | 100 % | 150/150 | 0 % | 0 % |
Total (excluding extensions) | 94 % | 1726/1830 | - | - |
NGLYD
This program is licensed under the GNU General Public License v3.0
About
Compiler of a subset of Zig (IFJ24)