For example, the CFG can produce: 6+(4-(5)+3) OR (7+7+(1-2)+9) OR -6+(-3+7+(9-1))
I have the following rules:
S→T|SS|(S)|e
T→exp•op•exp
nonzero→1|2|3|4|5|6|7|8|9
digit→0|1|2|3|4|5|6|7|8|9
num→nonzero•digit*
op→+|-
exp→num|(num)|op•num|(op•num)
However, the above rules can produce empty parenthesis (e.g. (()()) ) and it cannot produce the aforementioned examples.