"3 * 4 + 5" "x + (4 - 5 * y" // not grammatically correct "x + )y - z(" // not grammatically correct "x + * y" // not grammatically correct A "parser" is an algorithm that should convert the strings of grammatically correct expressions into a tree data structure that the interpreter/compiler can use. "3 + 4 * 5" + abstract syntax tree / \ expression tree 3 * / \ 4 5 "3 * 4 + 5" + / \ * 5 / \ 3 4 "(3 + 4) * 5" * / \ + 5 / \ 3 4 "if (x == y) print(x) else print(y)" if abstract syntax tree / | \ / | \ / | \ == print print / \ | | x y x y