-var typeName = (x : TokenMatcheePair)=>
-{
- return thenDo(toSome(x), orDo(typeABS, tId));
-}
+/** single1 = tInt | "(" expr ")"*/
+let single1 = circumfix((x : TokenMatcheePair) =>
+ thenDo(thenDo(thenDo(tk.toSome(x), tLParen), expr), tRParen), "fac1");
+let single2= tInt;
+let single = orDo(single1, single2);
+
+/** fac1 = single "(" int ")" | single */
+let fac1Appliee = circumfix((x : TokenMatcheePair) => thenDo(thenDo(thenDo(tk.toSome(x), tLParen), tInt), tRParen), "fac1");
+let fac1 = (x : TokenMatcheePair) =>
+ {
+ let n = thenDo(thenDo(toSome(x), single), fac1Appliee);
+
+ console.log("+"+"bocchitherock"+"+"+repr(n));
+
+ return n
+ };
+let fac2 = single;
+let fac = orDo(fac1, fac2);
+