Although both sentences include the exact same words, they have a different meaning due to the missing comma. In sentence 1, the speaker is inviting her grandmother to eat with him/her. On the other hand, in sentence 2, the speaker is telling someone to join him/her to eat a human being: her/his grandmother. Therefore, while in sentence 1 the word 'grandma' is in the vocative case, in sentence 2 the word 'grandma' in is the accusative case.