this may not be the answer you seek, but I would try simply: ASTProgramUnitName programUnitName() #ProgramUnitName : {} { <bar> | <foo><dot><bar> }