Does FreeMarker support a public Java API for the parsing of templates to syntax nodes and visitation of those nodes?
Given a FreeMarker template, I'd like inquire it for the tree structure of its elements, their positions in the template source and their other properties.
As an example, how would one get the macros defined in a template (freemarker.template.Template.getMacros() is deprecated and for internal use), each of the macros' start and end offsets in the template as well as similar information regarding those macros' nested blocks?
Another example would be the possibility to parse a template source into a syntax node tree which can then be used to alter a specific source element of the template. An alternative which is preferable to the option of manual parsing and String extraction.