Hi, I am currently trying to work with the Lexer/Parser of FreeMarker as well as the Lexer/Parser of the target language to support syntax-safe generation. Thus, it would be nice to just use the FreeMarker library to parse FreeMarker templates as it is also possible with the javaparser I am using.
I respect the idea of only providing APIs, which will be backward compatible in future. Nevertheless, The TokenManager as well as the Parser do follow a commonly used API Pattern, which should be quite stable and could be made accessible. I do not claim to support these APIs actively by providing any documentation. It just makes life easier for those, who want to provide further tool support for FreeMarker template editors as well as further language engineers trying to use or adapt FreeMarker as a meta-language for any (possibly research) intention. Providing the lexer and parser with your deployment for free eventually would establish FreeMarker even more due to more potential tool support. Currently, I somehow managed to work with the non-public TokenManager and Parser API by hacking accessibility via reflection. I know this is not a stable approach, but I am fine with it to just get the lexer token stream and the parser token stream to work on further ideas. Best Regards, Malte -----Ursprüngliche Nachricht----- Von: Daniel Dekany [mailto:[email protected]] Gesendet: Freitag, 11. September 2015 17:53 An: Malte Brunnlieb Betreff: Re: Using FreeMarkers Parser and Lexer That the related API-s are not public or are public but marked as internal/deprecated is because FM doesn't provide backward compatibility there. So you might as well copy them into your package and change the visibilities, etc. What exactly do you want to achieve? Thursday, September 10, 2015, 11:33:42 AM, Malte Brunnlieb wrote: > Hi all, > > due to my current research, I try to access FreeMarkers Parser and/or > Lexer appropriately, but it seems, that you have already successfully > hidden the most necessary classes to do so. > The only thing, I am currently able to do is to get the parsed element > root. Nevertheless, also this API seems to be deprecated. > > I also tried to work directly with the FTL.jj defintion, but you > adapted the API of the Parser and Lexer Exceptions I cannot simply > reuse from your library. > > I know that my issue is a very special and advanced use case, but do > you see any possibility to work with the latest FreeMarker > Lexer/Parser by simple library reuse? > > Best Regards, > Malte > > -- Thanks, Daniel Dekany
