#4
S -> Q { ('+' | '-') Q } // input expression is one or more Q's separated by signs Q -> T { ',' T} // quantity is one or more P's separated by commas T -> N U // term is a numeral and a unit N -> D {D} // numeral is one or more digits U -> L {L} // unit is one or more letters D -> '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' L -> 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z