>> > >> According to: >> http://clang.llvm.org/comparison.html#elsa >> >> "Elsa does not have an integrated preprocessor, which makes it >> extremely difficult to accurately map from a source location in the >> AST back to its original position before preprocessing. Like GCC, it >> does not keep track of macro expansions." >> >> which probably implies that clang (as opposed to elsa) has such an >> integrated preprocessor. Maybe it makes >> it possible to do some refactoring. Maybe they have something similar >> to the OriginTok and ExpandedTok in ast_c.ml > > It's possible. But I'm not sure why a compiler front end would be > motivated to keep track of comments.
Because they are aware that language frontends now are not used only for compiling but also use in IDE and refactoring tools ? On http://clang.llvm.org/index.html they say: # Support diverse clients (refactoring, static analysis, code generation, etc) # Allow tight integration with IDEs That said I am not a big fan of LLVM. I've heard people trying to use LLVM to implement a JIT and it turned out LLVM was not offering much more than a portable assembler. It may be simpler to extend my C++ parser than trying to integrate with their. > But perhaps it would be possible to > extend it to record comments without too much difficulty. > > thanks, > julia _______________________________________________ Cocci mailing list [email protected] http://lists.diku.dk/mailman/listinfo/cocci (Web access from inside DIKUs LAN only)
