while this may not be the problem, it's a good idea to add catching of EOF to your top grammar rule: main: STATIC_MAIN '{' stats '}' EOF; can't you narrow down the error, stripping away as much as possible? It would be easier to find then... cheers Michael