On 7/22/14 12:07 PM, "Christofer Dutz" <christofer.d...@c-ware.de> wrote:
>The way I understood JBurg is that it seems to have been designed to >manipulate ASTs produced by Antlr2 and Antlr3. >Therefore it has a compile and runtime dependency to Antlr (I also sort >of dislike them bundling the generator together with the runtime stuff) >but nevertheless ... I can't really use JBurg with Antlr4 in my project >not without splitting the module up but I think that's rather ugly. I'm definitely not an expert on the subject. I'm surprised the AST has any Antlr-isms in it. Maybe Gordon can confirm. When I look at the AST, I don't see anything I find surprising. > >I too was thinking about making JBurg obsolete too ... the way I >understand Antlr4 it looked as if it provided a lot which could make life >a lot easier. For example currently the ASParser creates the AST objects >and JBurg then performs it's magic on that AST tree. In Antlr4 I could >create a Parser-Listener that produces the AST object (Probably needed >for IDE suppoer) but could probably create a second listener that >directly outputs flash bytecode. I think this approach should be maximum >performant, maximum simple and use only a fragment of the memory the >current solutions need ... Sort of XML Dom processing (old AST parsing) >and SAX (Antlr4 direct Bytecode output). I have not played with SAX much nor Antlr, so I have no idea about parser/listener. I will say that there are times folks want to create the AST and then manipulate it before generating the output, so unless there is a huge performance win, making sure there is a way to do that would be preferred. > >But I also think that this would be quite an effort. Perhaps I should >split up my falcon-antlr4 branch even more and sort of start with the CSS >parser and as soon as that's up and running get the output running ... >then we could compare the performance of both and see if it's worth going >down that path. Don't want to waste time I could be working on Flexmojos, >or the new Flex-Maven-Plugin for a less performant solution. But if it >was faster (I would expect it to be) it could be quite breakthough ... >after all I have never seen several datastructure conversions be faster >than direct output. Up to you since you are doing the work. I just want to make sure you don't feel like you have to keep all of these subsystems like Jburg and Jflex around. -Alex