I'm not sure C languages โโhave this, however Java has a few packages that really make sense for this.
The JavaCC compiler or java compiler allows you to define a language (for example, your expressions), and they build the appropriate java classes. Somewhat more convenient, if not more experimental and academic DemeterJ package - this allows you to very easily specify the language of expression and comes with a library for defining visitors and strategies for working on the created class structure. If you could afford to switch to Java, I can try this. Otherwise, I would be looking for the C # -lon of one of these technologies.
Another thing to consider if you go down this route is that once you have formed your class structure in some reasonable approximation of the final result, you can subclass all generated classes and build all your application-specific input into the system subclasses. Thus, if you really need to restore a new model for the expression language, your logic will be relatively independent of your class hierarchy.
Update: it actually looks like some of these materials have been ported to .NET technology, although I haven't used it, so I'm not sure what form it might be:
http://www.ccs.neu.edu/home/lieber/inside-impl.html
Good luck
source share