You can find the Grammar for C language here.
I have attached the reduced grammar that we worked on in this repo.
- While being in the
curent repo, i.e.,C-Parseruse the folowing command in the terminal to run.
./build <file_path_to_parse>
- Output will be printed on the terminal.
- If you do not wan't file contents to be printed, goto
src/parser.cppfile and changePRINT_FILE_CONTENTSto anything other than 1.
- First and Follow Table has been given here.
- Predictive Parsing Table has been given here.
- 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 |