Relative Content

Tag Archive for cparsing

How the recursive decent parse for infix math notation works?

Taken from: Infix Calculator Expression Parser
I liked the code it looked simple but without need any complex tree like data structure
but I cant get my head around how it works.
I tried running it with gdb and I see that when ignore it called it reads data which makes no sense.
I get confused how the data is being read!
Every scan it resets the buffer
why it needs has such a big buffer
it reads 1 char by 1 char
I do not understand the grammar and recursion and how it sets precedence. What is the program flow ?
Can anyone help me understand ?