How should CallExpression looks like?

Hi,

I want to ask how CallExp should looks like, the example we have in the project description doesn’t contain a token .
thanks

The project description has the example Call [ Var_foo , Const_42 ], which corresponds to a call foo(42).

Furthermore, Call[name, args?] means that:

  • foo() becomes Call[ Var_foo ]
  • foo(1, 2, 3) becomes Call[ Var_foo, Const_1, Const_2, Const_3 ]

createCallExpression(Token token, Expression callee, List arguments)

thanks but what is Token in this case ?

1 Like

The token is actually the left parenthesis that indicates a function call.
It is only needed because it contains a location, which you need for printError.

2 Likes