I've implemented a level oriented breadth first renumbering algorithm, but I didn't like how I had to write the semantic rules for Leaf:
sem Bin
| Leaf lhs.res = { Leaf @x }
(loc.x, lhs.xss) = { let ((x:xs):xss) = @lhs.xss in (x, (x+1:xs):xss) }
I would like to write this instead:
sem Bin
| Leaf lhs.res = { Leaf @x }
loc.((x : xs) : xss) = @lhs.xss
lhs.xss = ((@x+1) : @xs) : @xss
But UUAGC doesn't parse infix constructors yet:
Main.ag:23:18: error: parser expecting symbol ) or @ or (symbol , ...)*
pattern :
help :
action : deleting: symbol : at line 23, column 18 of file "Main.ag"
I've implemented a level oriented breadth first renumbering algorithm, but I didn't like how I had to write the semantic rules for
Leaf:I would like to write this instead:
But UUAGC doesn't parse infix constructors yet: