adding classes for productions and production rules