If I define my grammar as definition: HELLO type SEMI the parser makes a call to definition and everything works fine. But if I change the grammar to main: (definition)* definition: HELLO type SEMI the parser makes a call to main and I get NoSuchElementException. Can someone explain to me why this happens? Thanks.