Skip to content

This repo is for our PPL (CS-2-07(MO)) assignment.

Notifications You must be signed in to change notification settings

vrajpat3ll/C-Parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grammar

You can find the Grammar for C language here.

I have attached the reduced grammar that we worked on in this repo.


How to run

  1. While being in the curent repo, i.e., C-Parser use the folowing command in the terminal to run.
./build <file_path_to_parse>
  1. Output will be printed on the terminal.
  2. If you do not wan't file contents to be printed, goto src/parser.cpp file and change PRINT_FILE_CONTENTS to anything other than 1.

To Know

  1. First and Follow Table has been given here.
  2. Predictive Parsing Table has been given here.
  3. We used the following syntax to print colored text in terminal.
\e[<color code>m<text>\e[0m

Color Code
Black 30
Red 31
Green 32
Yellow 33
Blue 34
Magenta 35
Cyan 36
White 37