Skip to content

A compiler for Cshort, a simplified C-like language for a Fundamentals of Compilers course project.

Notifications You must be signed in to change notification settings

FNevs/compiler-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cshort Compiler

About The Project

This repository contains a compiler for Cshort, a simple C-like language, developed for the Fundamentals of Compilers course. The compiler performs lexical, syntax, and semantic analysis, followed by code generation, converting .cshort files into an saida.mp output file.

How to Compile the Code

cd src/
gcc -o compilador Analex.c main.c Anasint.c Anasem.c GeradorCodigo.c TabIdent.c

How to Run the Compiler

./compilador teste.cshort

Output

The compiled output will be generated as src/saida.mp

File Structure

├── afd/                     # Deterministic Finite Automaton (DFA)
├── materials/               # Supporting materials
└── src/
    ├── Analex.c / .h        # Lexical Analyzer
    ├── Anasem.c / .h        # Semantic Analyzer
    ├── Anasint.c / .h       # Syntax Analyzer
    ├── GeradorCodigo.c / .h # Code Generator
    ├── TabIdent.c / .h      # Symbol Table
    ├── main.c               # Compiler Entry Point
    └── saida.mp             # Output file generated after execution

About

A compiler for Cshort, a simplified C-like language for a Fundamentals of Compilers course project.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages