❔ System.Linq.Expressions custom expression
Hi guys!
I'm parsing a custom language and building an Expression Tree based on it, but I came into an issue:
My language can use Labels, but since I parse the file line by line, I can't reference a label that hasn't been parsed yet when creating a
So parsing something like that would give issues:
So, my idea was to inherit the
Could you guys give me a hand?
Current parsing code:
If there is a way to make a custom
I'm parsing a custom language and building an Expression Tree based on it, but I came into an issue:
My language can use Labels, but since I parse the file line by line, I can't reference a label that hasn't been parsed yet when creating a
Goto expression.So parsing something like that would give issues:
So, my idea was to inherit the
Expression class to create a kind of LazyGotoExpression, where the LabelTarget would be evaluated by the time the expression is compiled, but I have no clue how to do that.Could you guys give me a hand?
Current parsing code:
If there is a way to make a custom
Expression return another Expression instance, that would be perfect.