translated lexer/parser into c, also hopefully made it a bit more efficent