LL1 parser implementation