I want to write the grammar for a list containing sequentially increasing integers like this
1 X
1 X 2 X
1 X 2 X 3 X
1 X 2 X 3 X 4 X
// and so on
I want to use a recursive definition to avoid defining separate rules for each case manually.
Without the increasing integers, I could write the following recursive grammar (in McKeeman Form)
NumberedList
Int X
Int X NumberedList
How can I specify the increasing integers?