In an Assignment, I was asked to write a CFG for functions like:
def f(x, y): return x + y
def g(x, y): return x – y
def h(x, y, z): return x + y % z
def w(x, y, z): return x * y – z
and
def h1(x, y, z): return (x + y) % z
def h2(x, y, z): return x + y % z
I have tried to work it up as a normal CFG but, I could not do it for function definitions and function bodies. I am not pretty sure how to start with this kind of CFG's.