Good day, I'm trying to find a way to program a lambda expression generator in java with this context-free grammar, and I would want to ask ; what would be the best way to tackle this problem and be able to manipulate them with basic lambda calculus functions such as beta reduction, alpha conversion, etc.?
I tried doing this with Strings, but was advised to discontinue because using strings will limit me to what I can do.
Here's the Context Free Grammar I got over the internet:
<expr> ::= <var> | <func> <arg> # This is an application. | lambda <var> . <expr> # This is an abstraction. <func> ::= <var> | (lambda <var> . <expr>) | <func> <arg> <arg> ::= <var> | (lambda <var> . <expr>) | (<func> <arg>) <var> ::= a| b| .... | Z