bruno-medeiros1 / Parser-for-Mini-C

This project was made in the 2nd year and 1st semester of Computer Science in UTAD, Portugal. :school:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parser for Mini C Language 💻

This project consists in implementing a mini C compiler using lex and yacc.

Team Members

  1. Bruno Medeiros
  2. Joel Pinto -> GitHub Account: https://github.com/Fockester
  3. Jorge Machado -> GitHub Account: https://github.com/Twixxx79

Phases

  1. DONE Lexical analyser
  2. DONE Parser
  3. DONE Latex Report

Parser Specifications

The syntactic analyser should parse programs that contain:

  • Whole and real numbers
  • Declaration of variables: int, float, char, void, double
  • Assignment instructions and instructions while, for, if, else, printf
  • Data structures: struct
  • Other commands: #include
  • Operators: <=,> =, == ,! =, <,>
  • Comments: text between / ∗ and ∗ /

It can also detected multiple errors in multiple lines and tell which token is missing.

Observations

  1. The report file was written in portuguese as so the comments in the .yac and .l files.
  2. The main.c file contains an example code written in naive C (simplistic C) where it contains 3 errors that will be detected by the parser when executed.

Thanks for reading! 😄

About

This project was made in the 2nd year and 1st semester of Computer Science in UTAD, Portugal. :school:


Languages

Language:TeX 67.4%Language:Yacc 24.3%Language:Lex 6.2%Language:C 2.1%