Can you attach the actual rules file? I'm totally unable to reproduce this problem, but it's failing during the parse. That error means that when the string K = k g ng is split on \s*=\s*, the result has more or less than 2 parts. Normally, there should be exactly 2, K and k g ng. This error message is slightly better than the one that was originally produced, which is just an IndexOutOfBoundsException.