An implementation of expr in C