reworked expression grammar to support RD algorithm specifications