Lexing + Parising
For my math parser I implemented the lexer and the parser. The lexer splits the mathematical input into tokens. The recursive descent parser parses those tokens into an abstract syntax tree.
For me the most interesting part was learning about different parsing techniques which also tought me a lot about compilers.
Next up I will implement the evaluation of expressions to calculate inputs like 2 + 3 * 5. Due to the design of the tree it should already respect pemdas.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.