Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Compiler of a subset of Zig (IFJ24)

License

NotificationsYou must be signed in to change notification settings

fifixsandy/NGLYD-IFJ24-Compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

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.

Environment

Linux

Build

TargetDescriptionCommand Example
devCompiles source files into objects and links them.make dev
testRuns the test script using the compiled binary and interpreter.make test
packCreates a zip package of source code and documentation.make pack
docCompiles the LaTeX documentation into a PDF.make doc
runRuns the compiled executable with input/output redirection.make run

Usage

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.

Test outputs and percentages

ModuleScorePassed/TotalIncorrect Return CodesIncorrect Outputs
Lexical Analysis (error detection)91 %192/2108 %-
Syntax Analysis (error detection)97 %261/2672 %-
Semantic Analysis (error detection)98 %394/4021 %-
Code Interpretation (basic)96 %346/3602 %1 %
Code Interpretation (expressions, built-ins)100 %170/1700 %0 %
Code Interpretation (complex)86 %363/42113 %0 %
Function Expressions (FUNEXP)100 %150/1500 %0 %
Total (excluding extensions)94 %1726/1830--

Authors

NGLYD

License

This program is licensed under the GNU General Public License v3.0


[8]ページ先頭

©2009-2025 Movatter.jp