I would like to parse "[a;b;c;d;e;f;g]" as "a::b::c::d::e::f::g::[]" In my part of my parser I have
listOps:
| combOps COLONCOLON listOps { Bin($1,Cons,$3) }
| combOps SEMI listOps { Bin($1,Cons,$3) }
| combOps { $1 }
;
and I have this further down.
| LBRAC RBRAC { NilExpr }
| LBRAC listOps RBRAC { $2 }
But I'm not sure how to get it to read the list between the "[" and "]" as having a "::[]" at the end of it. Any ideas?