> You're not traversing anything, it just happens that the base class is > abstract and defines callbacks for recursion. In your case you just want a > "processing" compiler pass. > > A plain old compiler pass wouldn't require visiting all nodes, just a > process(). > > Don't worry about it, the two you overrode are just stubs.
Well, I got I did an override :-) I just was trying to understand the base classes. Anyway, thanks again Mike for your explanations ! I will now go back on Falcon starting from the beginning trying to understand the scan / parse phase, even if I understand approximatively how theoretically it should work, it seems a huge thing to me in there, I see JFlex, ANTLR, btw I thought it was possible to do the scan / parse with ANTLR only, am I wrong ? if not why are we using JFlex too ? I will try to experiment, even with ANTLR4.x Frédéric THOMAS ---------------------------------------- > Date: Thu, 9 Jul 2015 11:25:09 -0400 > Subject: Re: [FalconJX] Collection Imports branch > From: [email protected] > To: [email protected] > > You're not traversing anything, it just happens that the base class is > abstract and defines callbacks for recursion. In your case you just want a > "processing" compiler pass. > > A plain old compiler pass wouldn't require visiting all nodes, just a > process(). > > Don't worry about it, the two you overrode are just stubs. > > Mike > > On Thu, Jul 9, 2015 at 11:13 AM, Frédéric THOMAS <[email protected]> > wrote: > >>> Other than that, merge/commit it man! thanks, looks good to me, we will >> see >>> if anything else comes up. >> >> Thanks, done ! >> >> But I'm still confuse with the pattern: >> >> I didn't get well this thing about pre / post order in the Callback >> interface maybe I didn't get what it means, isn't supposed to be recursive >> descendant only, how does it work ? >> I used process() which traverseRoots of both externs (the most out of >> parent) and the given node, why 2 nodes have to be traversed in the same >> function ? >> >> Frédéric THOMAS >> >> >> ---------------------------------------- >>> Date: Wed, 8 Jul 2015 16:46:34 -0400 >>> Subject: [FalconJX] Collection Imports branch >>> From: [email protected] >>> To: [email protected] >>> >>> Hey Fred, >>> >>> Couple things; >>> >>> 1. CollectImportsPass >>> >>> Should probably be; (process() only gets called once) >>> >>> @Override >>> public void process(Node externs, Node root) >>> { >>> for (ClassReference reference : model.getClasses()) >>> { >>> collectClassImports(reference); >>> } >>> >>> for (FunctionReference reference : model.getFunctions()) >>> { >>> collectFunctionImports(reference); >>> } >>> } >>> >>> @Override >>> public boolean shouldTraverse(final NodeTraversal nodeTraversal, final >>> Node n, final Node parent) >>> { >>> return false; >>> } >>> >>> @Override >>> public void visit(final NodeTraversal t, final Node n, final Node >>> parent) >>> { >>> } >>> >>> >>> Other than that, merge/commit it man! thanks, looks good to me, we will >> see >>> if anything else comes up. >>> >>> Mike >> >>
