I worked on creating the Syntax analyzer for my Risc-V compiler. This stage checks the structure of the program and any grammatical errors. I had to do a lot of research on CFGs (Context free grammars). They define the rules for the language. Below is a spreadsheet of the CFG. I will improve it in the future to add more functions. I implemented an LL(1) parser. I was successfully able to check the grammar of a simple program. I still need to make the parser construct an abstract syntax tree. I realized that it is quite difficult to find pictures to post because it mostly happens in the console, but trust me, interesting things are happening!
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.