Serialization of ANTLR ParseTree
问题 I have a generated grammar that does two things: Check the syntax of a domain specific language Evaluate input against that domain specific language These two functions are separate, lets call them validate() and evaluate(). The validate() function builds the tree from a String input while ensuring it meets the requirements of the BNF for the language. The evaluate() function plugs in values to that tree to get a result (usually true or false). What the code is currently doing is running