LL(1) Top-down parser

Implementation of a parser for a given grammar

Featured image

Project Overview

The goal of the project was to implement a parser for the grammar of a mini-C language.

The parser takes a string (program) as input and returns the parse tree (list of grammar rules) corresponding to that program.

We had to verify (manually) that the grammar below is LL(1) to ensure the deterministic nature of the parser to be built.

Language Grammar

Program ::= main() {declaration_list statement_list}
declaration_list ::= declaration declaration_list empty
declaration ::= type id
statement_list ::= statement statement_list empty
statement ::= assignment test
type ::= int float
assignment ::= id=number;
test ::= if condition statement else statement>
condition ::= id operator number
operator ::= < > =

Implemented Features

So, where can I find this project?

On my GitHub, at the following link: https://github.com/FredericCanaud/AnalyseDescendanteCompilation ;)