Yongjae Park
Yongjae Park

Reputation: 1

JavaCC parser function calls

I am making a parser which handles multiple line input. The input program define some functions and main line is for the result. For example, define function A which has { x+3 } (x is parameter for function A). If main line call function A such as MAIN { A(1+3) }, then how can I call the function A to calculate the expression in the MAIN line.

Upvotes: 0

Views: 2087

Answers (1)

Theodore Norvell
Theodore Norvell

Reputation: 16241

Normally your parser would translate the function to a representation that can be stored and interpreted later. See my answer to how do I implement loops (For) in javacc for more.

Upvotes: 2

Related Questions