This post is part of the Introduction to parsing series. In the last part we have worked on some preliminary changes to our parser to handle variables. In this part, we will actually make our parser understand variables! Grammar changes and more lookahead tokens After a couple of clean-up commits, we are ready to start extending our parser. The grammar is currently this: program: [end-of-line]* [expression end-of-line+]* expression: term [ ('+'|'-') term ]*; term : factor [ ('*'|'/') factor]*...| andreabergia.com
This post is part of the Introduction to parsing series. In the last part we have taught our parser how to handle function calls. For this time variables were promised… but it turns out we have some details to handle before we can get to them. Onwards!| Andrea Bergia's Website