I need to convert a list into a function. I've managed to make the list into a list of tuples. So I have something like this now:
[Expr, (Expr, [[T"("; N Expr; T")"]; [N Num]; [N Expr; N Binop; N Expr]; [N Lvalue]; [N Incrop; N Lvalue]; [N Lvalue; N Incrop]]
Lvalue, [[T"$"; N Expr]])]
I want the final result to look something like:
(Expr,
function
| Expr ->
[[N Term; N Binop; N Expr];
[N Term]]
| Lvalue ->
[[T"$"; N Expr]])
I'm mostly stuck on how I can implement the OR symbols (|). Any advice would be greatly appreciated. Thanks!