extended and bugfixed EBNFParser